delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/05/09:55:01

From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: no warning without #include
Date: Sat, 05 Feb 2000 15:49:17 +0200
Organization: NetVision Israel
Lines: 16
Message-ID: <389C2A5D.3D02396C@is.elta.co.il>
References: <87gugg$gpe$1 AT news0 DOT skynet DOT be>
NNTP-Posting-Host: ras1-p49.rvt.netvision.net.il
Mime-Version: 1.0
X-Trace: news.netvision.net.il 949758580 10916 62.0.172.51 (5 Feb 2000 13:49:40 GMT)
X-Complaints-To: abuse AT netvision DOT net DOT il
NNTP-Posting-Date: 5 Feb 2000 13:49:40 GMT
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en,ru,hebrew
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Newline wrote:
> 
> So i used the strcpy function but not included <string.h>. When i compile
> this with DJGPP gcc
> I'm not able to get any warning that I didn't include string.h. Why is this
> ?
> (I used 'gcc -c test.c -o test.o -Wall' to compile)

That's because GCC generates inline code for strcpy (and some other
functions) whenever their arguments are compile-time constants, like in your
case.

Try adding -fno-builtin, and you will see your warning about strcpy.

I don't know if the lack of a warning is a bug; I suggest posting a question
to the gnu.gcc.bug news group, where the GCC maintainers will answer it.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019