gcc-4.4.1: HOSTCC scripts/basic/fixdep scripts/basic/fixdep.c: In function 'traps': scripts/basic/fixdep.c:377: warning: dereferencing type-punned pointer will break strict-aliasing rules scripts/basic/fixdep.c:379: warning: dereferencing type-punned pointer will break strict-aliasing rules (Apparently -fno-strict-aliasing will fix this too)
Showing the changes to scripts/basic (1 of 1 file). Show all
Unified · Split
| @@ -373,10 +373,11 @@ void print_deps(void) · 372 unmodified lines | |||
| 373 | void traps(void) | 373 | void traps(void) |
| 374 | { | 374 | { |
| 375 | static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; | 375 | static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; |
| 376 | int *p = (int *)test; | ||
| 376 | 377 | ||
| 377 | if (*(int *)test != INT_CONF) { | 378 | if (*p != INT_CONF) { |
| 378 | fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", | 379 | fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", |
| 379 | *(int *)test); | 380 | *p); |
| 380 | exit(2); | 381 | exit(2); |
| 381 | } | 382 | } |
| 382 | } | 383 | } |