[Bug c/59668] New: extraneous error messages at -O1, -O2 and -O3 for valid code with string library functions
su at cs dot ucdavis.edu
gcc-bugzilla@gcc.gnu.org
Fri Jan 3 20:36:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59668
Bug ID: 59668
Summary: extraneous error messages at -O1, -O2 and -O3 for
valid code with string library functions
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: su at cs dot ucdavis.edu
The current trunk and older GCC versions reject the following code with odd
error messages at -O1, -O2 and -O3 (but not -O0 and -Os).
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 4.9.0 20140103 (experimental) [trunk revision 206321] (GCC)
$
$ gcc-trunk -Wall -Wextra -pedantic -std=c99 -c small.c
$
$ gcc-trunk -O0 -c small.c
$ gcc-trunk -Os -c small.c
$
$ gcc-trunk -O1 -c small.c
In file included from /usr/include/string.h:637:0,
from small.c:1:
small.c:3:5: error: expected identifier or ‘(’ before ‘__extension__’
int strcmp(const char *, const char *);
^
small.c:3:5: error: expected identifier or ‘(’ before ‘)’ token
int strcmp(const char *, const char *);
^
$
-----------------------
#include <string.h>
int strcmp(const char *, const char *);
More information about the Gcc-bugs
mailing list