From: Amerigo Wang Date: Wed, 10 Jun 2009 19:48:23 +0000 (-0700) Subject: kbuild: fix a compile warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d067aa741589a9783cc43315119e0f431b4e382c;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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) Signed-off-by: WANG Cong Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 8912c0f5460..72c15205bb2 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -373,10 +373,11 @@ void print_deps(void) void traps(void) { static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; + int *p = (int *)test; - if (*(int *)test != INT_CONF) { + if (*p != INT_CONF) { fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", - *(int *)test); + *p); exit(2); } }