[Bug other/20426] New: error: initializer element is not constant

pluto at pld-linux dot org gcc-bugzilla@gcc.gnu.org
Fri Mar 11 13:12:00 GMT 2005


# test.c
static const unsigned major = 0;
static const unsigned minor = 9;
static const unsigned build = 1;
const unsigned version = (major << 24) | (minor << 16) | build;

# gcc -c test.c
test.c:4: error: initializer element is not constant

Hmm, which initializer isn't constant? Do I missed something?

-- 
           Summary: error: initializer element is not constant
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at pld-linux dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-linux
  GCC host triplet: i686-linux
GCC target triplet: i686-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20426



More information about the Gcc-bugs mailing list