klibc/scripts/basic/fixdep.c: In function 'traps': klibc/scripts/basic/fixdep.c:368: warning: dereferencing type-punned pointer will break strict-aliasing rules klibc/scripts/basic/fixdep.c:370: warning: dereferencing type-punned pointer will break strict-aliasing rules klibc/usr/dash/jobs.c: In function 'sprint_status': klibc/usr/dash/jobs.c:427: warning: format not a string literal and no format arguments klibc/usr/dash/trap.c: In function 'exitshell': klibc/usr/dash/trap.c:354: warning: variable 'status' might be clobbered by 'longjmp' or 'vfork' Signed-off-by: Maciej ?enczykowski <maze at google.com> --- scripts/basic/fixdep.c | 9 ++++++--- usr/dash/jobs.c | 2 +- usr/dash/trap.c | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 0b61bea..cf72251 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -363,11 +363,14 @@ void print_deps(void) void traps(void) { - static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; + union { + int i; + char c[4]; + } test = { .c = "CONF" }; - if (*(int *)test != INT_CONF) { + if (test.i != INT_CONF) { fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", - *(int *)test); + test.i); exit(2); } } diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c index bf770dd..43b6b98 100644 --- a/usr/dash/jobs.c +++ b/usr/dash/jobs.c @@ -424,7 +424,7 @@ sprint_status(char *s, int status, int sigonly) goto out; #endif } - col = fmtstr(s, 32, strsignal(st)); + col = fmtstr(s, 32, "%s", strsignal(st)); if (WCOREDUMP(status)) { col += fmtstr(s + col, 16, " (core dumped)"); } diff --git a/usr/dash/trap.c b/usr/dash/trap.c index 18c3cd1..d6706c6 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -351,7 +351,7 @@ exitshell(void) { struct jmploc loc; char *p; - int status; + volatile int status; #ifdef HETIO hetio_reset_term(); -- 1.7.1
On Tue, Oct 19, 2010 at 02:11:16PM -0700, Maciej ?enczykowski wrote:> klibc/scripts/basic/fixdep.c: In function 'traps': > klibc/scripts/basic/fixdep.c:368: warning: dereferencing type-punned pointer will break strict-aliasing rules > klibc/scripts/basic/fixdep.c:370: warning: dereferencing type-punned pointer will break strict-aliasing rules > > klibc/usr/dash/jobs.c: In function 'sprint_status': > klibc/usr/dash/jobs.c:427: warning: format not a string literal and no format arguments > > klibc/usr/dash/trap.c: In function 'exitshell': > klibc/usr/dash/trap.c:354: warning: variable 'status' might be clobbered by 'longjmp' or 'vfork'cool please sent the dash patches as patch on it's own first against upstream dash git://git.kernel.org/pub/scm/utils/dash/dash.git To: dash at vger.kernel.org Cc: Herbert Xu <herbert at gondor.apana.org.au> We prefer to import dash from there then later on. thank you. -- maks
On Tue, Oct 19, 2010 at 02:11:16PM -0700, Maciej ?enczykowski wrote:> klibc/scripts/basic/fixdep.c: In function 'traps': > klibc/scripts/basic/fixdep.c:368: warning: dereferencing type-punned pointer will break strict-aliasing rules > klibc/scripts/basic/fixdep.c:370: warning: dereferencing type-punned pointer will break strict-aliasing rulesthanks for reporting it, made me look it up in linux-2.6 and will merge similar then d067aa741589a9783cc43315119e0f431b4e382c here unless you object? prefer to stay on that chosen path to minimise diff. -- maks
That sounds fine. 2010/10/19 maximillian attems <max at stro.at>:> On Tue, Oct 19, 2010 at 02:11:16PM -0700, Maciej ?enczykowski wrote: >> klibc/scripts/basic/fixdep.c: In function 'traps': >> klibc/scripts/basic/fixdep.c:368: warning: dereferencing type-punned pointer will break strict-aliasing rules >> klibc/scripts/basic/fixdep.c:370: warning: dereferencing type-punned pointer will break strict-aliasing rules > > thanks for reporting it, made me look it up in linux-2.6 > and will merge similar then d067aa741589a9783cc43315119e0f431b4e382c > here unless you object? > > prefer to stay on that chosen path to minimise diff. > > > -- > maks >