This is the mail archive of the gcc-help@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]

Re: warning: comparison with string literal results in unspecified behaviour


Russell Shaw wrote:
Russell Shaw wrote:
Russell Shaw wrote:
Andrew Haley wrote:
Russell Shaw wrote:
Andrew Haley wrote:
Russell Shaw wrote:
How do i disable that? My code explicitly compares string pointers.

...


Scrap that example. ob3->magic == MAGIC is two separate strings.

My code is full of that problem and has been relying on gcc combining identical strings into one address. It has worked, but probably isn't guaranteed.

It definitely isn't guaranteed. :-)


I'll change to some kind of internment thing. Thanks for
the help.

Cool, good luck.


Andrew.


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