[LLVMbugs] [Bug 6935] New: clang: -pedantic warnings by default and no way to turn off

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 25 02:46:43 PDT 2010


           Summary: clang: -pedantic warnings by default and no way to
                    turn off
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu
            Blocks: 4068

Another testcase from Linux kernel. It warns. It shouldn't.

struct ext4_group_info {
        unsigned long   bb_state;
        int     bb_counters[];
struct sg {
                struct ext4_group_info info;
                int counters[16];
} sg;

p4.c:6:26: warning: field 'info' with variable sized type 'struct
ext4_group_info' not at the end of a struct or class is a
      GNU extension [-pedantic]
                struct ext4_group_info info;
1 diagnostic generated.

All these warn, none should since I didn't specify -pedantic:
clang p4.c -c
clang p4.c -std=gnu99 -c
clang p4.c -std=gnu89 -c
clang p4.c -no-pedantic -c

clang should have a way to turn off these warnings since they are useless for
the Linux kernel (we already know it uses GNU extensions, and there are no
reasons to change that).

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list