This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/54823] New: string literal characters not constant


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

             Bug #: 54823
           Summary: string literal characters not constant
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: devel@fresse.org


this:

int main(void)
{
  int c = *" ";
  printf("%x\n", c);
  return 0;
}

results in (the constant expression):

     movl    $32, %eax

But this:

int main(void)
{
  enum {foo = *" "};
  printf("%x\n", foo);
  return 0;
}

gives
error: enumerator value for 'foo' is not an integer constant.

Whereas icc for instance just accepts the second form as constant integer
expression.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]