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]

Question about <string.h>


I want to use stpcpy in a program. The man page sez to include <string.h>
When I do that, the compiler does *not* see the decl for stpcpy. The decl
is surrounded by #ifdef __USE_GNU. Ok. So I rerun the compile with
-D__USE_GNU. It doesn't help. In fact if I run with -dM to see what macros
*are* defined I explicitly see that __USE_GNU is not defined.

Here's a min.c:
#include <string.h>
main ()
{
    stpcpy ();
}

The dreaded command line:
gcc -c -v -O2 -Wall min.c

output from compiler:

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/cpp -lang-c -v -undef
-D__GNUC__=2 -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D__i386__
-Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix
-D__i386 -D__linux -Asystem(posix) -D__OPTIMIZE__ -Wall -Asystem(unix)
-Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ min.c
/tmp/cc5W1FRz.i
GNU CPP version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) (i386
Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/i386-redhat-linux/include
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/cc1 /tmp/cc5W1FRz.i
-quiet -dumpbase min.c -O2 -Wall -version -o /tmp/ccwyz0C3.s
GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
(i386-redhat-linux) compiled by GNU C version egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release).
min.c:3: warning: return-type defaults to `int'
min.c: In function `main':
min.c:4: warning: implicit declaration of function `stpcpy'
min.c:5: warning: control reaches end of non-void function
 as -V -Qy -o min.o /tmp/ccwyz0C3.s
GNU assembler version 2.9.1 (i686-pc-linux-gnu), using BFD version
2.9.1.0.24

cmd output from gcc -v -E -dM min.c | grep USE_GNU

[NULL output]

I'd really love to understand this.

I already posted this to the hedwig list but the people there aren't
brieat enuff to solve this one. ;-)

I'm sure there's something really stoopid going on here.

TIA

-- 
-Time flies like the wind. Fruit flies like a banana. steveo@world.std.com-
-Stranger things have happened but none stranger than this. Steven W. Orr-
Does your driver's license say Organ Donor?Black holes are where God \
-------divided by zero. Listen to me! We are all individuals!---------




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