wrote:
> Is the output of the C preprocessor deterministic ? What I mean
> by that is , given 2 compilers which conform to the same standard,
> will their preprocessors produce identical output given as input
> the same file ?
Even if you ignore that there is no standard file format for
preprocessed output, and that preprocessed output need not be
obtainable at all, then no, output may be very different.
> If not then how much variation is allowed ? Is it
> just a bit more or less white space here and there or could could
> there be larger differences ?
Much larger. Some easy examples:
#ifndef __i386__
#error
#endif
#if 18446744073709551615U + 1
#error
#endif
#define f(x) g
#define g(x) f
f(1)(2)(3) /* either f(3) or g */
#define s(x) #x
s("\u0040") /* either "\"\u0040\"" or "\"\\u0040\"" */