1da2e3ebdSchinC preprocessor features: 2da2e3ebdSchin 3da2e3ebdSchin(1) The preprocessor is centered around the libpp.a library. This 4da2e3ebdSchin library provides a tokenizing implementation of the preprocessing 5da2e3ebdSchin stages of ANSI standard C. The same library is used to construct 6da2e3ebdSchin a standalone prepreprocessor as well as a C compiler front end 7da2e3ebdSchin that, compiled with the library, eliminates the need for a 8da2e3ebdSchin separate preprocessing pass. Other C tools requiring C tokenizing 9da2e3ebdSchin can use this library, providing a common interface to C language 10da2e3ebdSchin tokens. 11da2e3ebdSchin 12da2e3ebdSchin(2) The #pragma interface is exploited to allow the addition of new 13da2e3ebdSchin directives and #pragma's without changing the preprocessor 14da2e3ebdSchin executable. Most implementation details can be specified by 15da2e3ebdSchin directives in the file "ppdefault.h" that is automatically included 16da2e3ebdSchin (by the standalone cpp library wrapper) as an initialization step. 17da2e3ebdSchin 18da2e3ebdSchin(3) #assert, #unassert and corresponding #if predicate tests have been 19da2e3ebdSchin added to relieve the conflicts introduced by predefined #define 20da2e3ebdSchin macros (e.g., unix, vax, u3b, ...). This is the same feature 21da2e3ebdSchin present in the extended Reiser cpp that has been included in the 22da2e3ebdSchin nmake distribution. (NOTE: #assert is a failed experiment) 23da2e3ebdSchin 24da2e3ebdSchin(4) The implementation is sensitive to the incompatible differences 25da2e3ebdSchin between the Reiser cpp (used by AT&T and BSD compilers) and the new 26da2e3ebdSchin ANSI standard C. A compatibility dialect implements Reiser 27da2e3ebdSchin features, allowing for a smooth transition to the ANSI standard. 28da2e3ebdSchin 29da2e3ebdSchin(5) To aid in the transition to ANSI, the preprocessor can do some 30da2e3ebdSchin operations that would normally be done by the lexical analysis 31da2e3ebdSchin stage of a compiler front end: 32da2e3ebdSchin 33da2e3ebdSchin (a) convert new-style character constants to a form 34da2e3ebdSchin recognized by all current compilers 35da2e3ebdSchin 36da2e3ebdSchin (b) concatenate adjacent string literals 37da2e3ebdSchin 38da2e3ebdSchin(6) The preprocessor can also warn about obsolete constructs used 39da2e3ebdSchin in the compatibility dialect and on non-standard constructs 40da2e3ebdSchin used in the ANSI dialect. The latter is useful in writing 41da2e3ebdSchin C code that is made to run through other implementations of 42da2e3ebdSchin ANSI standard C. 43da2e3ebdSchin 44da2e3ebdSchin(7) The preprocessor allows a C language implementor to take 45da2e3ebdSchin advantage of local extensions without invalidating the 46da2e3ebdSchin conformance of the C language implementation. 47da2e3ebdSchin 48da2e3ebdSchinC9X additions: 49da2e3ebdSchin 50da2e3ebdSchin(1) #pragma STDC ... 51da2e3ebdSchin special forms always accecpted 52da2e3ebdSchin 53da2e3ebdSchin(2) _Pragma unary operator for pragmas via macro expansion 54da2e3ebdSchin _Pragma(string-literal) 55da2e3ebdSchin #pragma a b c 56da2e3ebdSchin _Pragma("a b c") 57da2e3ebdSchin 58da2e3ebdSchin(3) keywords 59da2e3ebdSchin restrict inline _Bool _Complex _Imaginary 60da2e3ebdSchin 61da2e3ebdSchin(4) macros 62da2e3ebdSchin __STDC_VERSION__ 199901L 63da2e3ebdSchin __STDC_IEC_559__ 1 or undef 64da2e3ebdSchin __STDC_IEC_559_COMPLEX__ 1 or udef 65da2e3ebdSchin __STDC_ISO_10646__ yyyymmL 66da2e3ebdSchin 67da2e3ebdSchin(5) empty arguments allowed in function-like macros 68da2e3ebdSchin 69da2e3ebdSchin(6) variable arguments via ... 70da2e3ebdSchin __VA_ARGS__ in replacement list only, expands to var args 71da2e3ebdSchin only var args is ok (shall only appear in ...) 72da2e3ebdSchin 73da2e3ebdSchin(7) hex floating constant with binary exponents 74da2e3ebdSchin xxxxxx[pP]dddd 75da2e3ebdSchin 76da2e3ebdSchin(8) // style comments 77da2e3ebdSchin 78da2e3ebdSchin(9) universal characters, even in identifiers! 79da2e3ebdSchin \uxxxx \Uxxxxxxxx 80da2e3ebdSchin 81da2e3ebdSchin(10) LL ll ULL ull suffix for long long literals 82da2e3ebdSchin 83da2e3ebdSchin(11) <stdarg.h> has va_copy() 84