This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [ebuddington@mail.wesleyan.edu: cccp.c::print_help() not called.]


> A while ago I was failing to fix a problem of autoconf wherein ./configure
> did macro substitution with cpp, which had undesired, built-in defines.
> I just now discovered the 'cpp -u' switch, which does what I want, but
> doesn't appear in 'cpp --help'.
> 
> The cpp in the *build* directory gives the expected help message (from
> cccp.c), but the xcpp that gets installed seems to be a different beast
> entirely (basically a teraked gcc, according to the Makefile). I assume
> that cccp.c is just for bootstrapping?

It's complicated.  cccp.c is the real preprocessor (in 2.95).  It
can't be used all by itself, it needs some help from the gcc driver.
xcpp is the gcc driver customized appropriately to work as /bin/cpp.

> I propose that cccp.c::print_help() and cpp.c::display_help get moved into
> cppspec.c and gccspec.c, respectively, in order to give more relevant
> help for whatever program is invoked. Do you agree?

You're right that 'cpp --help' is not at all helpful.  You might try
'cpp -v --help', which will get you three! copies of the help text you
wanted... but that doesn't mention the option you need either.
Bleah.  Patches for both issues coming right up.

There is no -u option; you must mean -undef.  Except that that doesn't
do what it's documented to do...

$ /work/inst/bin/cpp -undef -dM /dev/null
#define __i386__ 1
#define __tune_pentiumpro__ 1
#define i386 1
#define __i386 1

Note that in addition to the list you see there, there's about a dozen
more internal defines which it won't tell you about in -dM and which
can't be turned off at all:

__TIME__
__DATE__
__VERSION__
__STDC__
__SIZE_TYPE__
__PTRDIFF_TYPE__
__WCHAR_TYPE__
__FILE__
__BASE_FILE__
__LINE__
__INCLUDE_LEVEL__
__USER_LABEL_PREFIX__
__REGISTER_PREFIX__
__HAVE_BUILTIN_SETJMP__

I will be delighted to make cpp do the Right Thing as soon as we all
agree on what that is.  Should cpp -undef define *anything*?
Including the builtins?

You might have noticed the '-A-' option; it doesn't work at all.
That too will be fixed shortly.

zw

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]