preprocessor and gcc specific forms
Kathleen Fisher
kfisher@research.att.com
Mon Feb 12 07:26:00 GMT 2001
I am using the preprocessor of gcc version 2.96. I feed the results into
a compiler for an experimental c-based domain-specific programming
language. With older versions of gcc, I was able to invoke the
preprocessor with the -U__GNUC__ option to tell gcc not to output gcc
specific forms. Using this option with gcc version 2.96 produces files
that still have gcc-isms. For example, invoking
gcc -U__GNUC__ -D__USE_ISOC9X__ short.c -E > out
on short.c:
#include <stdarg.h>
#include <stdlib.h>
main(){}
yields
****************************************************************
# 1 "short.c"
# 43 "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h" 1 3
typedef __builtin_va_list __gnuc_va_list;
# 110 "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h" 3
typedef __gnuc_va_list va_list;
# 2 "short.c" 2
# 26 "/usr/include/stdlib.h" 1 3
# 283 "/usr/include/features.h" 1 3
# 311 "/usr/include/features.h" 3
# 26 "/usr/include/stdlib.h" 2 3
# 34 "/usr/include/stdlib.h" 3
# 199 "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h" 1 3
typedef unsigned int size_t;
# 287 "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h" 3
typedef long int wchar_t;
# 34 "/usr/include/stdlib.h" 2 3
# 94 "/usr/include/stdlib.h" 3
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long int quot;
long int rem;
} ldiv_t;
# 133 "/usr/include/stdlib.h" 3
extern size_t __ctype_get_mb_cur_max (void) __THROW;
...
**********************************************************
Type __builtin_va_list and __THROW are not defined generally.
I am running
Red Hat Linux release 7.0 (Guinness)
Kernel 2.2.16-22smp on a 2-processor i686
Any suggestions on how to coax the gcc preprocessor not to output gcc
specific forms?
Thank you,
Kathleen Fisher
kfisher@research.att.com
More information about the Gcc-bugs
mailing list