diff options
author | Aaron Crane <arc@cpan.org> | 2017-10-12 15:46:20 +0200 |
---|---|---|
committer | Aaron Crane <arc@cpan.org> | 2017-10-21 16:51:53 +0100 |
commit | 516e10a9956d11346cdddceee7203ef7e6181dc0 (patch) | |
tree | 3bf553d17736770fe4109fd393c958dd6629af2b | |
parent | 6e876d890f021fe5f975eed6716986552e849b66 (diff) | |
download | perl-516e10a9956d11346cdddceee7203ef7e6181dc0.tar.gz |
Assume C89 "volatile" keyword
The Configure changes here were generated using a version of metaconfig
that makes U/perl/perlxv.U assume that the keyword exists, and prevents
U/modified/d_volatile.U from promising to define a "volatile" keyword;
otherwise, those units would bring in the relevant Configure probe anyway.
-rwxr-xr-x | Configure | 60 | ||||
-rw-r--r-- | Cross/config.sh-arm-linux | 1 | ||||
-rw-r--r-- | Cross/config.sh-arm-linux-n770 | 1 | ||||
-rw-r--r-- | NetWare/config.wc | 1 | ||||
-rw-r--r-- | NetWare/config_H.wc | 9 | ||||
-rw-r--r-- | Porting/Glossary | 5 | ||||
-rw-r--r-- | Porting/config.sh | 1 | ||||
-rw-r--r-- | Porting/config_H | 9 | ||||
-rwxr-xr-x | config_h.SH | 9 | ||||
-rw-r--r-- | configure.com | 1 | ||||
-rw-r--r-- | hints/mips.sh | 1 | ||||
-rw-r--r-- | hints/ultrix_4.sh | 4 | ||||
-rw-r--r-- | perl.h | 7 | ||||
-rw-r--r-- | plan9/config.plan9 | 9 | ||||
-rw-r--r-- | plan9/config_h.sample | 9 | ||||
-rw-r--r-- | plan9/config_sh.sample | 1 | ||||
-rw-r--r-- | symbian/config.sh | 1 | ||||
-rw-r--r-- | uconfig.h | 13 | ||||
-rw-r--r-- | uconfig.sh | 1 | ||||
-rw-r--r-- | uconfig64.sh | 1 | ||||
-rw-r--r-- | win32/config.ce | 1 | ||||
-rw-r--r-- | win32/config.gc | 1 | ||||
-rw-r--r-- | win32/config.vc | 1 | ||||
-rw-r--r-- | win32/config_H.ce | 9 | ||||
-rw-r--r-- | win32/config_H.gc | 9 | ||||
-rw-r--r-- | win32/config_H.vc | 9 |
26 files changed, 13 insertions, 161 deletions
@@ -928,7 +928,6 @@ d_vfork='' usevfork='' d_voidsig='' signal_t='' -d_volatile='' d_charvspr='' d_vprintf='' d_wait4='' @@ -16836,37 +16835,6 @@ eval $inlibc set quadmath.h i_quadmath eval $inhdr -: check for volatile keyword -echo " " -echo 'Checking to see if your C compiler knows about "volatile"...' >&4 -$cat >try.c <<'EOCP' -int main() -{ - typedef struct _goo_struct goo_struct; - goo_struct * volatile goo = ((goo_struct *)0); - struct _goo_struct { - long long_int; - int reg_int; - char char_var; - }; - typedef unsigned short foo_t; - char *volatile foo; - volatile int bar; - volatile foo_t blech; - foo = foo; -} -EOCP -if $cc -c $ccflags try.c >/dev/null 2>&1 ; then - val="$define" - echo "Yup, it does." -else - val="$undef" - echo "Nope, it doesn't." -fi -set d_volatile -eval $setvar -$rm_try - : Check basic sizes echo " " $echo "Choosing the C types to be used for Perl's internal types..." >&4 @@ -17060,10 +17028,6 @@ case "$i64type" in esac $echo "Checking how many bits of your UVs your NVs can preserve..." >&4 -: volatile so that the compiler has to store it out to memory. -if test X"$d_volatile" = X"$define"; then - volatile=volatile -fi $cat <<EOP >try.c #include <stdio.h> #$i_stdlib I_STDLIB @@ -17073,7 +17037,8 @@ $cat <<EOP >try.c #include <sys/types.h> #include <signal.h> #ifdef SIGFPE -$volatile int bletched = 0; +/* volatile so that the compiler has to store it out to memory */ +volatile int bletched = 0; $signal_t blech(int s) { bletched = 1; } #endif int main() { @@ -17124,10 +17089,6 @@ esac $rm_try $echo "Checking to find the largest integer value your NVs can hold..." >&4 -: volatile so that the compiler has to store it out to memory. -if test X"$d_volatile" = X"$define"; then - volatile=volatile -fi $cat <<EOP >try.c #include <stdio.h> @@ -17139,10 +17100,11 @@ main() { int count = 1; while(count < 256) { - $volatile NV up = value + 1.0; - $volatile NV negated = -value; - $volatile NV down = negated - 1.0; - $volatile NV got_up = up - value; + /* volatile so that the compiler has to store it out to memory */ + volatile NV up = value + 1.0; + volatile NV negated = -value; + volatile NV down = negated - 1.0; + volatile NV got_up = up - value; int up_good = got_up == 1.0; int got_down = down - negated; int down_good = got_down == -1.0; @@ -17207,10 +17169,6 @@ fi $rm_try $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4 -: volatile so that the compiler has to store it out to memory. -if test X"$d_volatile" = X"$define"; then - volatile=volatile -fi $cat <<EOP >try.c #include <stdio.h> #$i_stdlib I_STDLIB @@ -17226,7 +17184,8 @@ $cat <<EOP >try.c #include <sys/types.h> #include <signal.h> #ifdef SIGFPE -$volatile int bletched = 0; +/* volatile so that the compiler has to store it out to memory */ +volatile int bletched = 0; $signal_t blech(int s) { bletched = 1; } #endif @@ -24946,7 +24905,6 @@ d_vfork='$d_vfork' d_void_closedir='$d_void_closedir' d_voidsig='$d_voidsig' d_voidtty='$d_voidtty' -d_volatile='$d_volatile' d_vprintf='$d_vprintf' d_vsnprintf='$d_vsnprintf' d_wait4='$d_wait4' diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux index 9de265e073..51fca473e8 100644 --- a/Cross/config.sh-arm-linux +++ b/Cross/config.sh-arm-linux @@ -624,7 +624,6 @@ d_vfork='undef' d_void_closedir='undef' d_voidsig='define' d_voidtty='' -d_volatile='define' d_vprintf='define' d_vsnprintf='define' d_wait4='define' diff --git a/Cross/config.sh-arm-linux-n770 b/Cross/config.sh-arm-linux-n770 index c6903d0d0e..1739595746 100644 --- a/Cross/config.sh-arm-linux-n770 +++ b/Cross/config.sh-arm-linux-n770 @@ -496,7 +496,6 @@ d_vfork='undef' d_void_closedir='undef' d_voidsig='define' d_voidtty='' -d_volatile='define' d_vprintf='define' d_vsnprintf='define' d_wait4='define' diff --git a/NetWare/config.wc b/NetWare/config.wc index 2f8f5553ea..31593db2a6 100644 --- a/NetWare/config.wc +++ b/NetWare/config.wc @@ -613,7 +613,6 @@ d_vfork='undef' d_void_closedir='undef' d_voidsig='define' d_voidtty='' -d_volatile='define' d_vprintf='define' d_vsnprintf='undef' d_wait4='undef' diff --git a/NetWare/config_H.wc b/NetWare/config_H.wc index 436b061929..5c67388239 100644 --- a/NetWare/config_H.wc +++ b/NetWare/config_H.wc @@ -597,15 +597,6 @@ */ /*#define HAS_USLEEP /**/ -/* HASVOLATILE: - * This symbol, if defined, indicates that this C compiler knows about - * the volatile declaration. - */ -#define HASVOLATILE /**/ -#ifndef HASVOLATILE -#define volatile -#endif - /* HAS_WAIT4: * This symbol, if defined, indicates that wait4() exists. */ diff --git a/Porting/Glossary b/Porting/Glossary index 60536723ad..1e1deab174 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -2848,11 +2848,6 @@ d_voidtty (i_sysioctl.U): Otherwise (on USG probably), it is enough to close the standard file descriptors and do a setpgrp(). -d_volatile (d_volatile.U): - This variable conditionally defines the HASVOLATILE symbol, which - indicates to the C program that this C compiler knows about the - volatile declaration. - d_vprintf (d_vprintf.U): This variable conditionally defines the HAS_VPRINTF symbol, which indicates to the C program that the vprintf() routine is available diff --git a/Porting/config.sh b/Porting/config.sh index a050b33ffb..61b921ced9 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -637,7 +637,6 @@ d_vfork='define' d_void_closedir='undef' d_voidsig='define' d_voidtty='' -d_volatile='define' d_vprintf='define' d_vsnprintf='define' d_wait4='define' diff --git a/Porting/config_H b/Porting/config_H index 8ca64d8901..255303e72e 100644 --- a/Porting/config_H +++ b/Porting/config_H @@ -2748,15 +2748,6 @@ */ #define Signal_t void /* Signal handler's return type */ -/* HASVOLATILE: - * This symbol, if defined, indicates that this C compiler knows about - * the volatile declaration. - */ -#define HASVOLATILE /**/ -#ifndef HASVOLATILE -#define volatile -#endif - /* I_DIRENT: * This symbol, if defined, indicates to the C program that it should * include <dirent.h>. Using this symbol also triggers the definition diff --git a/config_h.SH b/config_h.SH index 66039d3d61..e2ff49dab0 100755 --- a/config_h.SH +++ b/config_h.SH @@ -2168,15 +2168,6 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #define Signal_t $signal_t /* Signal handler's return type */ -/* HASVOLATILE: - * This symbol, if defined, indicates that this C compiler knows about - * the volatile declaration. - */ -#$d_volatile HASVOLATILE /**/ -#ifndef HASVOLATILE -#define volatile -#endif - /* I_DIRENT: * This symbol, if defined, indicates to the C program that it should * include <dirent.h>. Using this symbol also triggers the definition diff --git a/configure.com b/configure.com index db85307a2f..f3048b84aa 100644 --- a/configure.com +++ b/configure.com @@ -6469,7 +6469,6 @@ $ WC "d_vms_shorten_long_symbols='" + d_vms_shorten_long_symbols + "'" ! VMS $ WC "d_void_closedir='define'" $ WC "d_voidsig='undef'" $ WC "d_voidtty='" + "'" -$ WC "d_volatile='define'" $ WC "d_vprintf='define'" $ WC "d_vsnprintf='" + d_vsnprintf + "'" $ WC "d_wait4='" + d_wait4 + "'" diff --git a/hints/mips.sh b/hints/mips.sh index bc0b7e8073..61ab39af32 100644 --- a/hints/mips.sh +++ b/hints/mips.sh @@ -1,5 +1,4 @@ perl_cflags='optimize="-g"' -d_volatile=undef d_castneg=undef cc=cc glibpth="/usr/lib/cmplrs/cc $glibpth" diff --git a/hints/ultrix_4.sh b/hints/ultrix_4.sh index e7360821ff..f32f06dba3 100644 --- a/hints/ultrix_4.sh +++ b/hints/ultrix_4.sh @@ -38,10 +38,6 @@ case "$cc" in *4.2*) ccflags="$ccflags -DLANGUAGE_C -Olimit 3800" # Prototypes sometimes cause compilation errors in 4.2. prototype=undef - case "$myuname" in - *risc*) d_volatile=undef ;; - esac - ;; *4.3*) ccflags="$ccflags -std1 -DLANGUAGE_C -Olimit 3800" ;; *) ccflags="$ccflags -std -Olimit 3800" ;; esac @@ -570,11 +570,8 @@ # define DONT_DECLARE_STD 1 #endif -#if defined(HASVOLATILE) || defined(STANDARD_C) -# define VOL volatile -#else -# define VOL -#endif +/* This exists only for back-compat. */ +#define VOL volatile /* By compiling a perl with -DNO_TAINT_SUPPORT or -DSILENT_NO_TAINT_SUPPORT, * you get a perl without taint support, but doubtlessly with a lesser diff --git a/plan9/config.plan9 b/plan9/config.plan9 index 4a2a305f75..1afcbaf1ea 100644 --- a/plan9/config.plan9 +++ b/plan9/config.plan9 @@ -607,15 +607,6 @@ */ /*#define HAS_USLEEP / **/ -/* HASVOLATILE: - * This symbol, if defined, indicates that this C compiler knows about - * the volatile declaration. - */ -#define HASVOLATILE /**/ -#ifndef HASVOLATILE -#define volatile /* config-skip */ -#endif - /* HAS_WAIT4: * This symbol, if defined, indicates that wait4() exists. */ diff --git a/plan9/config_h.sample b/plan9/config_h.sample index 6e76bddca7..766426e1ec 100644 --- a/plan9/config_h.sample +++ b/plan9/config_h.sample @@ -565,15 +565,6 @@ */ /*#define HAS_USLEEP / **/ -/* HASVOLATILE: - * This symbol, if defined, indicates that this C compiler knows about - * the volatile declaration. - */ -#define HASVOLATILE /**/ -#ifndef HASVOLATILE -#define volatile -#endif - /* HAS_WAIT4: * This symbol, if defined, indicates that wait4() exists. */ diff --git a/plan9/config_sh.sample b/plan9/config_sh.sample index 6315595cc0..f35bb1fea6 100644 --- a/plan9/config_sh.sample +++ b/plan9/config_sh.sample @@ -623,7 +623,6 @@ d_vfork='undef' d_void_closedir='undef' d_voidsig='define' d_voidtty='' -d_volatile='define' d_vprintf='define' d_vsnprintf='undef' d_wait4='undef' diff --git a/symbian/config.sh b/symbian/config.sh index 2af4d0dae3..90980d7921 100644 --- a/symbian/config.sh +++ b/symbian/config.sh @@ -571,7 +571,6 @@ d_vfork='undef' d_void_closedir='undef' d_voidsig='undef' d_voidtty='' -d_volatile='define' d_vprintf='define' d_vsnprintf='undef' d_wait4='undef' @@ -2133,15 +2133,6 @@ */ #define Signal_t int /* Signal handler's return type */ -/* HASVOLATILE: - * This symbol, if defined, indicates that this C compiler knows about - * the volatile declaration. - */ -/*#define HASVOLATILE / **/ -#ifndef HASVOLATILE -#define volatile -#endif - /* I_DIRENT: * This symbol, if defined, indicates to the C program that it should * include <dirent.h>. Using this symbol also triggers the definition @@ -5366,6 +5357,6 @@ #endif /* Generated from: - * b0245f5f4da83b1e4e1dbcd8ffe33f50da89f790dc389b2868fc620cf460c375 config_h.SH - * f8fa6d0de3a2fb09b8ae480de350caefa12b0272cc67b1bc9f7e02427a3e9a14 uconfig.sh + * de64a83defbfab2e684766a378e7304e30db7e2e8545430f86e0239f6850ac8a config_h.SH + * 034e09d42cd2ce87573eb1bd11b7169cb5a57d0d0741d379d39c1f3c4fc2f24e uconfig.sh * ex: set ro: */ diff --git a/uconfig.sh b/uconfig.sh index b5a7d2555f..616eab666f 100644 --- a/uconfig.sh +++ b/uconfig.sh @@ -562,7 +562,6 @@ d_vfork='undef' d_void_closedir='undef' d_voidsig='undef' d_voidtty='' -d_volatile='undef' d_vprintf='define' d_vsnprintf='undef' d_wait4='undef' diff --git a/uconfig64.sh b/uconfig64.sh index 0751f9ae22..0842bad2fc 100644 --- a/uconfig64.sh +++ b/uconfig64.sh @@ -563,7 +563,6 @@ d_vfork='undef' d_void_closedir='undef' d_voidsig='undef' d_voidtty='' -d_volatile='undef' d_vprintf='define' d_vsnprintf='undef' d_wait4='undef' diff --git a/win32/config.ce b/win32/config.ce index 55a5f57726..8ae01597b7 100644 --- a/win32/config.ce +++ b/win32/config.ce @@ -611,7 +611,6 @@ d_vfork='undef' d_void_closedir='undef' d_voidsig='define' d_voidtty='' -d_volatile='define' d_vprintf='define' d_vsnprintf='undef' d_wait4='undef' diff --git a/win32/config.gc b/win32/config.gc index 07d9a95afa..528dc93cd1 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -612,7 +612,6 @@ d_vfork='undef' d_void_closedir='undef' d_voidsig='define' d_voidtty='' -d_volatile='define' d_vprintf='define' d_vsnprintf='define' d_wait4='undef' diff --git a/win32/config.vc b/win32/config.vc index a1b116438d..f0dc118b0f 100644 --- a/win32/config.vc +++ b/win32/config.vc @@ -612,7 +612,6 @@ d_vfork='undef' d_void_closedir='undef' d_voidsig='define' d_voidtty='' -d_volatile='define' d_vprintf='define' d_vsnprintf='define' d_wait4='undef' diff --git a/win32/config_H.ce b/win32/config_H.ce index 8146c772e4..22cef32b43 100644 --- a/win32/config_H.ce +++ b/win32/config_H.ce @@ -547,15 +547,6 @@ */ /*#define HAS_USLEEP /**/ -/* HASVOLATILE: - * This symbol, if defined, indicates that this C compiler knows about - * the volatile declaration. - */ -#define HASVOLATILE /**/ -#ifndef HASVOLATILE -#define volatile -#endif - /* HAS_WAIT4: * This symbol, if defined, indicates that wait4() exists. */ diff --git a/win32/config_H.gc b/win32/config_H.gc index f2dbf3125a..ddb834b59c 100644 --- a/win32/config_H.gc +++ b/win32/config_H.gc @@ -2142,15 +2142,6 @@ */ #define Signal_t void /* Signal handler's return type */ -/* HASVOLATILE: - * This symbol, if defined, indicates that this C compiler knows about - * the volatile declaration. - */ -#define HASVOLATILE /**/ -#ifndef HASVOLATILE -#define volatile -#endif - /* I_DIRENT: * This symbol, if defined, indicates to the C program that it should * include <dirent.h>. Using this symbol also triggers the definition diff --git a/win32/config_H.vc b/win32/config_H.vc index 990c330cc3..0eb1f8a277 100644 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@ -2133,15 +2133,6 @@ */ #define Signal_t void /* Signal handler's return type */ -/* HASVOLATILE: - * This symbol, if defined, indicates that this C compiler knows about - * the volatile declaration. - */ -#define HASVOLATILE /**/ -#ifndef HASVOLATILE -#define volatile -#endif - /* I_DIRENT: * This symbol, if defined, indicates to the C program that it should * include <dirent.h>. Using this symbol also triggers the definition |