http://llvm.org/bugs/show_bug.cgi?id=6935

           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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
            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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to