Bug#443576: Strict aliasing problem

2007-09-23 Thread Ludovic Rousseau
Le 23.09.2007, à 10:22:15, Falk Hueffner a écrit: > "Phil Endecott" <[EMAIL PROTECTED]> writes: > > >> I think I found a bug in gcc-4.2 > > > >> int i, j; > >> printf("%d %d\n", j, (void *)(j)); > > > > This looks like a strict-aliasing issue to me; you're casting from an > > int to a void*, which

Bug#443576: Strict aliasing problem

2007-09-23 Thread Falk Hueffner
"Phil Endecott" <[EMAIL PROTECTED]> writes: >> I think I found a bug in gcc-4.2 > >> int i, j; >> printf("%d %d\n", j, (void *)(j)); > > This looks like a strict-aliasing issue to me; you're casting from an > int to a void*, which is undefined. Casting from int to void* is not undefined, but impl

Bug#443576: Strict aliasing problem

2007-09-22 Thread Phil Endecott
I think I found a bug in gcc-4.2 int i, j; printf("%d %d\n", j, (void *)(j)); This looks like a strict-aliasing issue to me; you're casting from an int to a void*, which is undefined. Did you get any warnings? (Did you compile with warnings enabled? -Wstrict-aliasing?) Investigate the -