fix cast warnings discovered by nwcc, and work around const optimisation

related over-zealous warnings by using a non-const integer value
This commit is contained in:
tg 2009-07-07 18:39:51 +00:00
parent d162ed09a4
commit fca27ce872
1 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.404 2009/07/07 18:38:49 tg Exp $' srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.405 2009/07/07 18:39:51 tg Exp $'
#- #-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Thorsten Glaser <tg@mirbsd.org> # Thorsten Glaser <tg@mirbsd.org>
@ -1003,14 +1003,14 @@ ac_testn sig_t <<-'EOF'
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
#include <stddef.h> #include <stddef.h>
int main(void) { return ((ptrdiff_t)(sig_t)0); } int main(void) { return ((int)(ptrdiff_t)(sig_t)kill(0,0)); }
EOF EOF
ac_testn sighandler_t '!' sig_t 0 <<-'EOF' ac_testn sighandler_t '!' sig_t 0 <<-'EOF'
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
#include <stddef.h> #include <stddef.h>
int main(void) { return ((ptrdiff_t)(sighandler_t)0); } int main(void) { return ((int)(ptrdiff_t)(sighandler_t)kill(0,0)); }
EOF EOF
if test 1 = $HAVE_SIGHANDLER_T; then if test 1 = $HAVE_SIGHANDLER_T; then
CPPFLAGS="$CPPFLAGS -Dsig_t=sighandler_t" CPPFLAGS="$CPPFLAGS -Dsig_t=sighandler_t"
@ -1021,7 +1021,7 @@ ac_testn __sighandler_t '!' sig_t 0 <<-'EOF'
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
#include <stddef.h> #include <stddef.h>
int main(void) { return ((ptrdiff_t)(__sighandler_t)0); } int main(void) { return ((int)(ptrdiff_t)(__sighandler_t)kill(0,0)); }
EOF EOF
if test 1 = $HAVE___SIGHANDLER_T; then if test 1 = $HAVE___SIGHANDLER_T; then
CPPFLAGS="$CPPFLAGS -Dsig_t=__sighandler_t" CPPFLAGS="$CPPFLAGS -Dsig_t=__sighandler_t"