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/17096] New: gcc-3.4.1 allows statements before declarations


gcc 3.4.1 (gcc 3.3.3 also) allows statements before declarations:

{
   int i1;

   printf("bla");

   int i2;
}

even if I use -ansi (and -Wall -Wshadow -Werror-implicit-function-declaration
-Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings)

I got no warning

gcc 2.95.3 and other c compilers
fail to compile that code

-- 
           Summary: gcc-3.4.1 allows statements before declarations
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: metze at samba dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17096


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