• Build.sh: fix a compiler warning which, had it not been irrelevant in

a mirtoconf check, would’ve been a real problem on an LP64 platform
• sh.h: work around a bad interaction between -Wformat on gcc and manual
  string pooling for T_synerr, which is used in place of a format string
  in some places
This commit is contained in:
tg 2010-10-01 19:04:38 +00:00
parent 895e8f584b
commit 3365cb8d0f
3 changed files with 13 additions and 8 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.461 2010/09/14 21:26:04 tg Exp $'
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.462 2010/10/01 19:04:35 tg Exp $'
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# Thorsten Glaser <tg@mirbsd.org>
@ -1137,14 +1137,14 @@ ac_testn sig_t <<-'EOF'
#include <sys/types.h>
#include <signal.h>
#include <stddef.h>
int main(void) { return ((int)(ptrdiff_t)(sig_t)kill(0,0)); }
int main(void) { return ((int)(ptrdiff_t)(sig_t)(ptrdiff_t)kill(0,0)); }
EOF
ac_testn sighandler_t '!' sig_t 0 <<-'EOF'
#include <sys/types.h>
#include <signal.h>
#include <stddef.h>
int main(void) { return ((int)(ptrdiff_t)(sighandler_t)kill(0,0)); }
int main(void) { return ((int)(ptrdiff_t)(sighandler_t)(ptrdiff_t)kill(0,0)); }
EOF
if test 1 = $HAVE_SIGHANDLER_T; then
CPPFLAGS="$CPPFLAGS -Dsig_t=sighandler_t"
@ -1155,7 +1155,7 @@ ac_testn __sighandler_t '!' sig_t 0 <<-'EOF'
#include <sys/types.h>
#include <signal.h>
#include <stddef.h>
int main(void) { return ((int)(ptrdiff_t)(__sighandler_t)kill(0,0)); }
int main(void) { return ((int)(ptrdiff_t)(__sighandler_t)(ptrdiff_t)kill(0,0)); }
EOF
if test 1 = $HAVE___SIGHANDLER_T; then
CPPFLAGS="$CPPFLAGS -Dsig_t=__sighandler_t"

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.394 2010/09/19 19:28:21 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.395 2010/10/01 19:04:37 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 $
@ -25,7 +25,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout:
@(#)MIRBSD KSH R39 2010/09/19
@(#)MIRBSD KSH R39 2010/10/01
description:
Check version of shell.
stdin:

9
sh.h
View File

@ -154,9 +154,9 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.416 2010/09/19 19:28:23 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.417 2010/10/01 19:04:38 tg Exp $");
#endif
#define MKSH_VERSION "R39 2010/09/19"
#define MKSH_VERSION "R39 2010/10/01"
#ifndef MKSH_INCLUDES_ONLY
@ -631,7 +631,12 @@ extern const struct shoption options[];
EXTERN char null[] I__("");
/* helpers for string pooling */
EXTERN const char T_intovfl[] I__("integer overflow %lu %c %lu prevented");
#if defined(__GNUC__)
/* trust this to have string pooling; -Wformat bitches otherwise */
#define T_synerr "syntax error"
#else
EXTERN const char T_synerr[] I__("syntax error");
#endif
EXTERN const char T_r_fc_e_[] I__("r=fc -e -");
#define T_fc_e_ (T_r_fc_e_ + 2) /* "fc -e -" */
#define Tn_fc_e_ 7 /* strlen(T_fc_e_) */