Skip to content

Commit d067aa7

Browse files
Amerigo Wangsravnborg
authored andcommitted
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]>
1 parent f2ac5e7 commit d067aa7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/basic/fixdep.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,11 @@ void print_deps(void)
373373
void traps(void)
374374
{
375375
static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
376+
int *p = (int *)test;
376377

377-
if (*(int *)test != INT_CONF) {
378+
if (*p != INT_CONF) {
378379
fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n",
379-
*(int *)test);
380+
*p);
380381
exit(2);
381382
}
382383
}

0 commit comments

Comments
 (0)