Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Meaning of the warning

Reply
Thread Tools

Meaning of the warning

 
 
Harald van Dijk
Guest
Posts: n/a
 
      12-14-2007
On Fri, 14 Dec 2007 17:48:06 -0500, CBFalconer wrote:
> Harald van D?k wrote:
>>

> ... snip ...
>>
>> (However, even without -Wwrite-strings, gcc has a bug in which the
>> equally strictly conforming
>>
>> int main(void) {
>> if (0) ""[0] = 'x';
>> }
>>
>> is unconditionally rejected.)

>
> Not a bug. "" is a constant string, stored in (possibly) constant
> memory, and thus is not writable. You may be complaining that gcc
> hasn't bother to notice that the statment won't be executed, and thus
> should suppress the message. However, compilers are allowed to emit all
> the messages they wish.


I am complaining not that GCC warns about this program (which would be
conforming), but that it issues an error message and refuses to compile
it at all, in all non-conforming, mostly-conforming, and conforming
modes. I posted quite clearly that the program was "unconditionally
rejected". If it got compiled, with or without warnings, it would have
been accepted.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Understanding search queries, semantics, and "Meaning" ...aren't weall looking for meaning? 5lvqbwl02@sneakemail.com Python 4 01-14-2009 02:28 PM
warning's meaning holmescn C++ 5 06-03-2007 02:42 PM
what is the meaning of the Warning message,why it occurs? nick C Programming 3 10-12-2005 06:11 PM
Re: what's meaning of "warning: initializer element is not computable at load time" bingfeng C Programming 3 06-06-2005 04:49 AM
what's meaning of "warning: initializer element is not computable at load time" bingfeng C Programming 4 06-02-2005 01:55 AM



Advertisments