Subject: gcc -nostdinc && -Wall
To: None <port-alpha@NetBSD.ORG>
From: John Birrell <cimaxp1!>
List: port-alpha
Date: 09/30/1995 09:56:14

When I compile a function (under NetBSD/Alpha) like ....

#include <stdio.h>
int main()

with the command...

cc -c -Wall testx.c

I get a clean compile (no warnings).

When I use the command...

cc -c -Wall -nostdinc -I/usr/include testx.c

I get the following warning...

/usr/include/stdio.h:335: warning: `__sputc' defined but not used

The two commands generate the same code (according to cmp), but I get a .text
entry in the object module (according to nm) for __sputc which I don't want.
If I do a nm on libc.a, there are lots of __sputc text entries. If I do a
nm of an executable (like /usr/bin/compress) I see lots of __sputc text
entries that the linker has put at different addresses.

When I do the same thing under NetBSD/i386 I don't get the warning and I don't
get __sputc in the object module. This seems like the _correct_ behavio[u]r.

Is this a problem with gcc? Chris, does your new compiler do the same thing?

BTW, I guess using -nostdinc with -I/usr/include sounds a bit silly, but I just
used that as a test case. What I'm actually compiling is a version of libc.a
with pthreads built in (so that we only have to maintain one lot of code).
To do this, I can't use the /usr/include directory because several header
files (like errno.h) have to change to support threaded code, so I have the
modified set of header files in /u/dev/usr/include and I only want to compile
against them.


John Birrell                                CIMlogic Pty Ltd                          119 Cecil Street
Ph  +61  3 9690 9600                        South Melbourne Vic 3205
Fax +61  3 9690 6650                        Australia
Mob +61 18  353  137