Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
TRADCPP(1)		    General Commands Manual		    TRADCPP(1)

NAME
       tradcpp -- traditional (K&R-style) C macro preprocessor

SYNOPSIS
       tradcpp [-options] [input-file [output-file]]

DESCRIPTION
       The tradcpp command provides a traditional K&R-style C macro preproces-
       sor.   It  is  intended	to be suitable for historical Unix uses	of the
       preprocessor, such as  imake(1),	 particularly  those  that  depend  on
       preservation of whitespace.

       The chief ways in which traditional cpp differs from Standard C are:

	     	 Macro arguments are expanded within quoted strings.  There is
		 no stringize operator.

	     	 There	is  no	token pasting operator;	tokens can be concate-
		 nated by placing comments between them.  This process is also
		 not limited to	valid C	language tokens.

	     	 Whitespace is preserved, and in particular tabs are  not  ex-
		 panded	 into  spaces.	 Furthermore, additional whitespace is
		 not injected.

OPTIONS
       tradcpp has many	options, many of which are defined  for	 compatibility
       with gcc(1) or other compilers.	Many of	the options are	not yet	imple-
       mented.

   Common Options
       -C	     Retain comments in	output.

       -Dmacro[=expansion]
		     Provide  a	 definition for	the named macro.  If no	expan-
		     sion is provided, the value "1" is	used.  Note that  like
		     many  Unix	compilers, tradcpp does	not accept a space be-
		     tween the "D" and the macro name.

       -Ipath	     Add the specified path to the main	list of	include	direc-
		     tories.  Note that	like many Unix compilers, tradcpp does
		     not accept	a space	between	 the  "I"  and	the  directory
		     name.

       -nostdinc     Do	not search the standard	system include directories.

       -P	     Suppress  line  number  information  in the output.  Cur-
		     rently line number	information is not  generated  at  all
		     and this option has no effect.

       -Umacro	     Remove any	existing definition for	the named macro.  Note
		     that  like	many Unix compilers, tradcpp does not accept a
		     space between the "U" and the macro name.

       -undef	     Remove all	predefined macros.

   Warning Options
       Warning options can be disabled or enabled by inserting,	 or  not,  the
       string  "no-" between the "W" and the warning name.  Herein the "-Wno-"
       form is shown for options that are enabled by default.

       -Wall	     Turn on all warnings.  The	option -Wno-all	disables  only
		     the warnings that are disabled by default.

       -w	     Turn off all warnings.

       -Werror	     Make warnings into	fatal errors.

       -Wcomment     Warn about	nested comments.

       -Wno-endif-labels
		     Don't  warn  about	symbols	attached to #endif directives.
		     (The warning is currently not implemented.)

       -Wundef	     Warn about	undefined symbols appearing in #if  and	 #elif
		     expressions.

       -Wunused-macros
		     Warn  about  macros that are defined and never used.  Not
		     implemented.

   Depend Options
       -M	     Generate dependency information for make(1) on the	 stan-
		     dard output, instead of preprocessing.  Not implemented.

       -MD	     Like -M but skip system headers.  Not implemented.

       -MM	     Like  -M  but  write the dependency information to	a file
		     named after the input file	with  extension	 .d  and  pre-
		     process normally to standard output.  Not implemented.

       -MMD	     Like -MM but skip system headers.	Not implemented.

       -MF file	     Send  dependency  output to the named file	instead	of the
		     default location.	Not implemented.

       -MG	     When generating dependency	information, assume that miss-
		     ing files are generated instead of	failing.   Not	imple-
		     mented.

       -MP	     Issue  dummy  rules for all include files.	 This prevents
		     make(1) from choking if an	include	file is	removed.   Not
		     implemented.

       -MQ target    Same  as  -MT  except that	any make(1) metacharacters ap-
		     pearing in	the target are escaped.

       -MT target    Set the name of the make(1) target	appearing in the  gen-
		     erated  dependency	 information.  The default is the name
		     of	the input file with its	suffix replaced	with the  suf-
		     fix for object files, normally .o.

   More	Include	Path Options
       -idirafter path
		     Add  the specified	path to	the "afterwards" include path.
		     This path is searched  after  all	directories  specified
		     with -I and the standard system directories.  Directories
		     on	 this  path  are  treated as containing	system include
		     files.

       -imacros	file
		     Read in file prior	to reading the main  input  file,  and
		     preprocess	 it, but throw away the	output and retain only
		     the macro definitions.

       -include	file
		     Read in and preprocess file prior to reading the main in-
		     put file.

       -iprefix	prefix
		     Set the path prefix used with the -iwithprefix option.

       -iquote path  Add path to the list of directories searched for  include
		     directives	  written  with	 quotes.   This	 list  is  not
		     searched for include directives written with angle	brack-
		     ets.

       -iremap string:replacement
		     Substitute	replacement for	string in the __FILE__	built-
		     in	macro.	Not supported.

       -isysroot path
		     Use path as the "system root", that is, the directory un-
		     der which the standard system paths are found.

       -isystem	path
		     Add path to the list of system include directories.  This
		     list  is  searched	 after	the  list given	with I.	 Files
		     found on this path	are treated as system headers.

       -iwithprefix dir
		     Splice dir	onto the prefix	given with  -iprefix  and  add
		     this directory as if it were specified with -idirafter.

       -iwithprefixbefore
		     Like -iwithprefix but adds	the result as if it were spec-
		     ified with	-I.

   Diagnostic Options
       -debuglog file
		     Write  a  trace  of actions and operations	to file	as the
		     input is processed.  Meant	for debugging problems in com-
		     plex substitution schemes fed to tradcpp, such  as	 those
		     used by imake(1).

       -dD	     Dump  all	macro  definitions,  except for	the predefined
		     macros, after the normal preprocessing output.   Not  im-
		     plemented.

       -dI	     Dump all include directives along with the	normal prepro-
		     cessing output.  Not implemented.

       -dM	     Dump  all macro definitions instead of the	normal prepro-
		     cessing output.  Not implemented.

       -dN	     Like -dD but emits	only macro names and  not  the	expan-
		     sions.  Not implemented.

       -H	     Output  a trace of	the include tree as it gets processed.
		     Not implemented.

   Other Options
       -CC	     Retain comments in	output.	 Same as -C, accepted for com-
		     patibility	with gcc(1).

       -fdollars-in-identifiers, -fno-dollars-in-identifiers
		     Enable (or	disable, respectively) the use of  the	dollar
		     sign in identifiers.  Not implemented.

       -ftabstop=num
		     Set  the  tab width to the	specified value, for reporting
		     column positions in diagnostics.  The default is 8.   Not
		     implemented.

       -std=standard
		     Ask  tradcpp  to  conform to the named standard.  The de-
		     fault, and	the only supported value, is "krc".

       -traditional  This option is accepted for compatibility with gcc(1) and
		     ignored.

       -x lang	     Adjust the	preprocessor for the given language.  The only
		     values accepted for  lang	are  "assembler-with-cpp"  and
		     "c",  neither of which have any effect on the behavior of
		     tradcpp.

FILES
       The default list	of directories searched	for include files is:
	     /usr/local/include
	     /usr/include

SEE ALSO
       cc(1), cpp(1), make(1)

STANDARDS
       None.  The whole	point of a traditional cpp is that it  reflects	 prac-
       tices in	pre-standardization implementations of C.  Some	information is
       available from the first	edition	of Kernighan and Ritchie.  Much	of the
       rest of the behavior is based on	lore, pragmatism, material encountered
       in the wild, and	comparison to other implementations.

HISTORY
       The  original  version of tradcpp was written one evening in late 2010.
       This version had	some problems and was put aside.   The	first  working
       version was released in June 2013.

BUGS
       Probably	plenty.

FreeBSD	Ports 14.quarterly	 June 11, 2013			    TRADCPP(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=tradcpp&sektion=1&manpath=FreeBSD+Ports+14.3.quarterly>

home | help