This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/54823] New: string literal characters not constant
- From: "devel at fresse dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 05 Oct 2012 11:12:47 +0000
- Subject: [Bug c/54823] New: string literal characters not constant
- Auto-submitted: auto-generated
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.