From 6d5e27a31a4301ba0732890827eaafaac723e0b6 Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 22 Dec 2012 00:03:42 +0000 Subject: [PATCH] gcc-snapshot (see below) issued a clobber warning, and both it and mgcc yowled about the memmove test until I found a compromise gcc version 4.8.0 20121120 (experimental) [trunk revision 193662] (Debian 20121120-1) --- Build.sh | 8 +++++--- check.t | 6 +++--- exec.c | 9 ++++----- sh.h | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Build.sh b/Build.sh index cc8a152..a5c095f 100644 --- a/Build.sh +++ b/Build.sh @@ -1,5 +1,5 @@ #!/bin/sh -srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.603 2012/12/17 23:31:30 tg Exp $' +srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.604 2012/12/22 00:03:37 tg Exp $' #- # Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 @@ -1527,7 +1527,7 @@ else #define EXTERN #define MKSH_INCLUDES_ONLY #include "sh.h" - __RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.603 2012/12/17 23:31:30 tg Exp $"); + __RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.604 2012/12/22 00:03:37 tg Exp $"); int main(void) { printf("Hello, World!\n"); return (0); } EOF case $cm in @@ -1644,12 +1644,14 @@ ac_test killpg <<-'EOF' EOF ac_test memmove <<-'EOF' + #include + #include #include #if HAVE_STRINGS_H #include #endif int main(int ac, char *av[]) { - return ((int)memmove(av[0], av[1], ac)); + return (*(int *)(void *)memmove(av[0], av[1], ac)); } EOF diff --git a/check.t b/check.t index 940c248..cf06e78 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.574 2012/12/17 23:46:31 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.575 2012/12/22 00:03:39 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -29,7 +29,7 @@ # http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD expected-stdout: - @(#)MIRBSD KSH R41 2012/12/17 + @(#)MIRBSD KSH R41 2012/12/21 description: Check version of shell. stdin: @@ -38,7 +38,7 @@ name: KSH_VERSION category: shell:legacy-no --- expected-stdout: - @(#)LEGACY KSH R41 2012/12/17 + @(#)LEGACY KSH R41 2012/12/21 description: Check version of legacy shell. stdin: diff --git a/exec.c b/exec.c index d047ca4..4568b53 100644 --- a/exec.c +++ b/exec.c @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.109 2012/12/17 23:18:03 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.110 2012/12/22 00:03:41 tg Exp $"); #ifndef MKSH_DEFAULT_EXECSHELL #define MKSH_DEFAULT_EXECSHELL "/bin/sh" @@ -1427,7 +1427,7 @@ iosetup(struct ioword *iop, struct tbl *tp) static int hereinval(const char *content, int sub, char **resbuf, struct shf *shf) { - const char *ccp; + const char * volatile ccp = content; struct source *s, *osource; osource = source; @@ -1441,14 +1441,13 @@ hereinval(const char *content, int sub, char **resbuf, struct shf *shf) if (sub) { /* do substitutions on the content of heredoc */ s = pushs(SSTRING, ATEMP); - s->start = s->str = content; + s->start = s->str = ccp; source = s; if (yylex(ONEWORD|HEREDOC) != LWORD) internal_errorf("%s: %s", "herein", "yylex"); source = osource; ccp = evalstr(yylval.cp, 0); - } else - ccp = content; + } if (resbuf == NULL) shf_puts(ccp, shf); diff --git a/sh.h b/sh.h index a207e19..0aa9da0 100644 --- a/sh.h +++ b/sh.h @@ -164,9 +164,9 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.619 2012/12/17 23:46:33 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.620 2012/12/22 00:03:42 tg Exp $"); #endif -#define MKSH_VERSION "R41 2012/12/17" +#define MKSH_VERSION "R41 2012/12/21" /* arithmetic types: C implementation */ #if !HAVE_CAN_INTTYPES