This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c/59668] New: extraneous error messages at -O1, -O2 and -O3 for valid code with string library functions


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 *);

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