-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
| Bugzilla Link | 2050 |
| Resolution | FIXED |
| Resolved on | Mar 12, 2010 00:57 |
| Version | unspecified |
| OS | Linux |
Extended Description
Using clang r47211, and llvm r47211 I cannot compile the code below.
gcc and icc compile the code without errors.
$ clang -fsyntax-only testcase-min.i
testcase-min.i:10:9: error: initializer element is not constant
{"OPEN", 1, &cdiff_cmd_open }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 diagnostic generated.
$ gcc -Wall -c testcase-min.i
testcase-min.i:9: warning: ‘commands’ defined but not used
$ icc -w2 -c testcase-min.i
testcase-min.i(9): remark #177: variable "commands" was declared but never referenced
static struct cdiff_cmd commands[] = {
^
$ cat testcase-min.i
struct cdiff_cmd {
const char *name;
unsigned short argc;
int (*handler)();
};
static int cdiff_cmd_open() {
return 0;
}
static struct cdiff_cmd commands[] = {
{"OPEN", 1, &cdiff_cmd_open }
};