This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
strncmp is now completly undeclared
- To: libstdc++ at gcc dot gnu dot org
- Subject: strncmp is now completly undeclared
- From: Andreas Jaeger <aj at suse dot de>
- Date: 26 May 2001 15:28:33 +0200
With current CVS mainline (checked out today around 10am UTC) I now
get the following error on i686-linux-gnu:
gromit:/tmp:[1]$ /opt/gcc-3.1-devel/bin/g++ string-test.cc -O2 -save-temps
In file included from /opt/gcc-3.1-devel/include/g++-v3/backward/iostream.h:31,
from string-test.cc:1:
/opt/gcc-3.1-devel/include/g++-v3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please use the <X> header instead of <X.h> header for 'C++' includes and use the <cX> header instead of <X.h> header for 'C' includes. To disable this warning use -Wno-deprecated.
string-test.cc: In function `int main()':
string-test.cc:9: `strncmp' undeclared (first use this function)
string-test.cc:9: (Each undeclared identifier is reported only once for each
function it appears in.)
The program is simply:
#include <iostream.h>
#include <string.h>
int
main (void)
{
char *a, *b;
return strncmp (a, b, 2);
}
Removing the inclusion of iostream.h "solves" the problem.
This is a IMO a severe regression from GCC 2.95.
Andreas
P.S. Here's the preprocessed file:
string-test.ii.bz2
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj