[Bug c/54823] string literal characters not constant

devel at fresse dot org gcc-bugzilla@gcc.gnu.org
Fri Oct 5 11:46:00 GMT 2012


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

--- Comment #3 from Sebastian Freundt <devel at fresse dot org> 2012-10-05 11:46:20 UTC ---
I'm more or less referring to the internals, why is it a constant expression in
the first case, but not treated as an integer constant expression.

Also, according to the rules of indirection (6.5.3.2):
If [a string literal X] has type "pointer to TYPE" then *X should have type X.

Now if internally *" " is a integer (or char) internally, and taking the rules
of indirection literally, then

  enum {foo = *" "};

should be (in my eyes) the same as

  enum {foo = (char)32};



More information about the Gcc-bugs mailing list