SYNOPSISucpp [ options ] [ file ]
ucpp is a C preprocessor mostly compatible with ISO-C99. It is rather strict and uses only a small amount of memory. It uses standard input as primary input if no file argument is given.
OPTIONSThere are several classes of options.
- Language Options
- keep comments in the output.
- if a rogue '#' is encountered, do not emit an error and keep it in the output.
- supress the emission of '#line' directives in the output.
- convert the '#line' to the gcc-style equivalent.
- disable C++-like comments (a '//' begins a comment, up to the end of the line). Use this option to get closer to C90 behaviour.
- -a, -na
- handle assertions (defined with #assert); -a also defines the standard assertions #machine , #cpu and #system (see -e to get the local definition of such assertions).
- disable assertion support.
- disable support for macros with a variable number of arguments: in C99, a macro may be declared with ... as the last argument; inside the replacement list, __VA_ARGS__ is replaced with the optional extra arguments given in the call to the macro. Use this option to get closer to C90 behaviour.
- enable UTF-8 support: with this option, the source is considered as an ISO/10646 source, encoded in UTF-8. Characters represented as two bytes or more are considered as alphabetic characters, like letters, and therefore usable in identifiers. These characters hold the same syntactic value than the corresponding Universal Character Names.
- enable -a, -u and -Y. This should make ucpp behave closer to what is requested from a "modern" C preprocessor.
- enable -V and -CC, and do not define __STDC_VERSION__. This should make ucpp mimic older C90 behaviour.
- disable trigraph support; this seems to be required for some legacy code.
- Warning Options
- emit a final warning when trigraphs are encountered.
- emit warnings for each trigraph encountered.
- emit annoying warnings (these are usually useless).
- supress standard warnings.
- Directory Options
- -I directory
- add directory to the include path, before the standard include path.
- -J directory
- add directory to the include path, after the standard include path.
- do not use the standard (compile-time) include path.
- emit only the names of encountered files, separated by spaces; this is intended for automatic generation of Makefile dependencies.
- do the same as -M but also for system files.
- -o file
- direct the ouput to file instead of standard output.
- Macro Options
- predefine macro with content 1.
- predefine macro with the content def.
- undefine macro.
- predefine system-dependant macros.
- do not predefine special macros such as __TIME__.
- add foo(bar) to the list of assertions.
- remove foo(bar) of the list of assertions; you may also use -Bfoo to remove all -Bfoo(xxx) from the list of assertions.
- instead of normal output, emit '#define' directives representing all macros defined during processing.
- instead of normal output, emit '#assert' directives representing all assertions defined during processing.
- Miscellaneous Options
- print version number, include path and (optionaly) defined assertions.
- print some help.
ucpp is not itself affected by environment variables. However, it uses library functions that might be affected, depending on the system.
AUTHORThomas Pornin <[email protected]>
ucpp is considered stable software. However improbable it is, please report bugs to the author (possibly with a file that exhibits the problem) if the latest version, available from this site:
has the bug.