This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [ebuddington@mail.wesleyan.edu: cccp.c::print_help() not called.]
- To: "Eric R. Buddington" <ebuddington at mail dot wesleyan dot edu>
- Subject: Re: [ebuddington@mail.wesleyan.edu: cccp.c::print_help() not called.]
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Sat, 1 Apr 2000 23:59:38 -0800
- Cc: gcc at gcc dot gnu dot org
- References: <20000401194444.P13353@wolery.cumb.org> <Pine.GSO.4.05.10004020148230.3603-100000@mail.wesleyan.edu>
On Sun, Apr 02, 2000 at 01:53:01AM -0500, Eric R. Buddington wrote:
> On Sat, 1 Apr 2000, Zack Weinberg wrote:
>
> > 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
>
> Probably not important at this point, but my cpp recognizes a -u option,
> which does something useful:
...
> bash-2.02$ cpp -u -dM /dev/null
> # 1 "/dev/null"
Yeah, but it doesn't do what you think it does. Watch:
$ cpp --version
2.95.2
$ cpp -dM /dev/null -u
cpp: argument to `-u' is missing
You thought it was undefining symbols because the -dM got eaten, so it
didn't print anything - but you would never have seen `# 1 "/dev/null"'
in -dM mode.
It turns out that -u is passed to the linker. From man ld:
-u sym Forces sym to be entered in the output file as an
undefined symbol. This may, for example, trigger
linking of additional modules from standard libraries.
-u may be repeated with different option arguments to
enter additional undefined symbols.
And no, the 'cpp' wrapper won't ever run the linker, but it recognizes
the option anyway.
zw