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] string literal characters not constant


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};


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