Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
kbuild: fix a compile warning
Browse files Browse the repository at this point in the history
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 <amwang@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Amerigo Wang authored and sravnborg committed Jun 14, 2009
1 parent f2ac5e7 commit d067aa7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/basic/fixdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit d067aa7

Please sign in to comment.