Bug#517653: gcc-4.3: "warning: comparison with string literal results in unspecified behavior" when comparing two different literals

2012-05-05 Thread Kalle Olavi Niemitalo
package gcc-4.3 found 517653 gcc-4.4/4.4.7-1 found 517653 gcc-4.6/4.6.3-1 found 517653 gcc-4.7/4.7.0-3 quit Kalle Olavi Niemitalo writes: > Compiling this with gcc-4.3 -Wall -c > > int > main (void) > { > return "hello" == "there"; > } > > results in a warning: > > hoh.c: In function ‘main’: >

Bug#517653: gcc-4.3: "warning: comparison with string literal results in unspecified behavior" when comparing two different literals

2009-03-01 Thread Falk Hueffner
On Sun, Mar 01, 2009 at 04:04:07PM +0200, Kalle Olavi Niemitalo wrote: > Falk Hueffner writes: > > > I can't imagine any sensible code whatsoever that triggers this > > warning but does not have logical errors. Can you show how it is used? > > Here are all the source lines from net-snmp 5.2.3-7e

Bug#517653: gcc-4.3: "warning: comparison with string literal results in unspecified behavior" when comparing two different literals

2009-03-01 Thread Kalle Olavi Niemitalo
Falk Hueffner writes: > I can't imagine any sensible code whatsoever that triggers this > warning but does not have logical errors. Can you show how it is used? Here are all the source lines from net-snmp 5.2.3-7etch4 that trigger this warning. snmplib/data_list.c:108 netsnmp_assert("li

Bug#517653: gcc-4.3: "warning: comparison with string literal results in unspecified behavior" when comparing two different literals

2009-03-01 Thread Falk Hueffner
On Sun, Mar 01, 2009 at 10:40:40AM +0200, Kalle Olavi Niemitalo wrote: > Compiling this with gcc-4.3 -Wall -c > > int > main (void) > { > return "hello" == "there"; > } > > results in a warning: > > hoh.c: In function ???main???: > hoh.c:4: warning: comparison with string literal results in un

Bug#517653: gcc-4.3: "warning: comparison with string literal results in unspecified behavior" when comparing two different literals

2009-03-01 Thread Kalle Olavi Niemitalo
Bastian Blank writes: > §6.4.5 6) say: > | It is unspecified whether these arrays are distinct provided their > | elements have the appropriate values. If the arrays resulting from "hello" and "there" were not distinct from each other, then their elements would not have the appropriate values.

Bug#517653: gcc-4.3: "warning: comparison with string literal results in unspecified behavior" when comparing two different literals

2009-03-01 Thread Bastian Blank
On Sun, Mar 01, 2009 at 10:40:40AM +0200, Kalle Olavi Niemitalo wrote: > results in a warning: > hoh.c: In function ‘main’: > hoh.c:4: warning: comparison with string literal results in unspecified > behavior > The warning claims the behaviour is unspecified. The warning is correct. The behaviour

Bug#517653: gcc-4.3: "warning: comparison with string literal results in unspecified behavior" when comparing two different literals

2009-03-01 Thread Kalle Olavi Niemitalo
Package: gcc-4.3 Version: 4.3.1-4 Severity: minor Compiling this with gcc-4.3 -Wall -c int main (void) { return "hello" == "there"; } results in a warning: hoh.c: In function ‘main’: hoh.c:4: warning: comparison with string literal results in unspecified behavior The warning claims the behav