[LLVMbugs] [Bug 6934] New: clang: should have a -Wno-* flag to turn off "initializer overrides prior initialization of this subobject"
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Apr 25 02:39:54 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=6934
Summary: clang: should have a -Wno-* flag to turn off
"initializer overrides prior initialization of this
subobject"
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
Testcase from Linux kernel, there should be a way to turn off this warning,
since it serves no useful purpose here:
typedef void (*sys_call_ptr_t)(void);
extern void sys_ni_syscall(void);
#define __SYSCALL(nr, call) [nr] = (call),
#define __NR_syscall_max 299
extern void sys_read(void) ;
const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
[0 ... __NR_syscall_max] = &sys_ni_syscall,
#define __NR_read 0
__SYSCALL(__NR_read, sys_read)
};
$ clang p3.c
p3.c:9:1: warning: initializer overrides prior initialization of this subobject
__SYSCALL(__NR_read, sys_read)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p3.c:3:36: note: instantiated from:
#define __SYSCALL(nr, call) [nr] = (call),
^~~~~~
p3.c:7:29: note: previous initialization is here
[0 ... __NR_syscall_max] = &sys_ni_syscall,
^~~~~~~~~~~~~~~
2 diagnostics generated.
--
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