History

kbuild: fix a compile warning

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)

Amerigo Wang committed 17 years ago

Commit d067aa71 parent f2ac5e71 file · +3 −2Browse files

Showing the changes to scripts/basic (1 of 1 file). Show all

Unified · Split

scripts/basic/fixdep.c+3−2
@@ -373,10 +373,11 @@ void print_deps(void) · 372 unmodified lines
373void traps(void)373void 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}