[LLVMbugs] [Bug 3797] New: initializer element is not a compile-time constant ( address of variable)

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Mar 13 03:08:27 PDT 2009


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

           Summary: initializer element is not a compile-time constant
                    (address of variable)
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: philippe.coucaud at nxp.com
                CC: llvmbugs at cs.uiuc.edu


Revision 66878

The following code is rejected by clang ("initializer element is not a
compile-time constant"):

> cat controls.c
typedef struct {
  int first_def;
} BAR;

static int foo;

BAR table[] = { {(int)&foo} };

> gcc -fsyntax-only controls.c
> clang -fsyntax-only controls.c
controls.c:7:15: error: initializer element is not a compile-time constant
BAR table[] = { {(int)&foo} };
              ^~~~~~~~~~~~~~~
1 diagnostic 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