Skip to content

Commit 9d82a2b

Browse files
committed
Rely on C89 <stdarg.h>
1 parent 3d97541 commit 9d82a2b

27 files changed

+4
-300
lines changed

Configure

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,9 +1078,6 @@ i_unistd=''
10781078
i_ustat=''
10791079
i_utime=''
10801080
i_values=''
1081-
i_stdarg=''
1082-
i_varargs=''
1083-
i_varhdr=''
10841081
i_vfork=''
10851082
i_wchar=''
10861083
d_inc_version_list=''
@@ -23279,115 +23276,6 @@ set i_termio; eval $setvar
2327923276
val=$val2; set i_sgtty; eval $setvar
2328023277
val=$val3; set i_termios; eval $setvar
2328123278

23282-
: see if stdarg is available
23283-
echo " "
23284-
if $test `./findhdr stdarg.h`; then
23285-
echo "<stdarg.h> found." >&4
23286-
valstd="$define"
23287-
else
23288-
echo "<stdarg.h> NOT found." >&4
23289-
valstd="$undef"
23290-
fi
23291-
23292-
: see if varargs is available
23293-
echo " "
23294-
if $test `./findhdr varargs.h`; then
23295-
echo "<varargs.h> found." >&4
23296-
else
23297-
echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
23298-
fi
23299-
23300-
: set up the varargs testing programs
23301-
$cat > varargs.c <<EOP
23302-
#ifdef I_STDARG
23303-
#include <stdarg.h>
23304-
#endif
23305-
#ifdef I_VARARGS
23306-
#include <varargs.h>
23307-
#endif
23308-
23309-
#ifdef I_STDARG
23310-
int f(char *p, ...)
23311-
#else
23312-
int f(va_alist)
23313-
va_dcl
23314-
#endif
23315-
{
23316-
va_list ap;
23317-
#ifndef I_STDARG
23318-
char *p;
23319-
#endif
23320-
#ifdef I_STDARG
23321-
va_start(ap,p);
23322-
#else
23323-
va_start(ap);
23324-
p = va_arg(ap, char *);
23325-
#endif
23326-
va_end(ap);
23327-
return 0;
23328-
}
23329-
EOP
23330-
$cat > varargs <<EOP
23331-
$startsh
23332-
if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
23333-
echo "true"
23334-
else
23335-
echo "false"
23336-
fi
23337-
$rm -f varargs$_o
23338-
EOP
23339-
chmod +x varargs
23340-
23341-
: now check which varargs header should be included
23342-
echo " "
23343-
i_varhdr=''
23344-
val=''
23345-
case "$valstd" in
23346-
"$define")
23347-
if `./varargs I_STDARG`; then
23348-
val='stdarg.h'
23349-
elif `./varargs I_VARARGS`; then
23350-
val='varargs.h'
23351-
fi
23352-
;;
23353-
*)
23354-
if `./varargs I_VARARGS`; then
23355-
val='varargs.h'
23356-
fi
23357-
;;
23358-
esac
23359-
case "$val" in
23360-
'')
23361-
echo " "
23362-
echo "*** WHOA THERE!!! ***" >&4
23363-
echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
23364-
case "$knowitall" in
23365-
'')
23366-
echo " I'm giving up; maybe you can try again with a different compiler?" >&4
23367-
exit 1
23368-
;;
23369-
esac
23370-
echo "I could not find the definition for va_dcl... You have problems..." >&4
23371-
val="$undef"; set i_stdarg; eval $setvar
23372-
val="$undef"; set i_varargs; eval $setvar
23373-
;;
23374-
*)
23375-
set i_varhdr
23376-
eval $setvar
23377-
case "$i_varhdr" in
23378-
stdarg.h)
23379-
val="$define"; set i_stdarg; eval $setvar
23380-
val="$undef"; set i_varargs; eval $setvar
23381-
;;
23382-
varargs.h)
23383-
val="$undef"; set i_stdarg; eval $setvar
23384-
val="$define"; set i_varargs; eval $setvar
23385-
;;
23386-
esac
23387-
echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
23388-
esac
23389-
$rm -f varargs*
23390-
2339123279
: see if stdbool is available
2339223280
: we want a real compile instead of Inhdr because some Solaris systems
2339323281
: have stdbool.h, but it can only be used if the compiler indicates it
@@ -24821,7 +24709,6 @@ i_rpcsvcdbm='$i_rpcsvcdbm'
2482124709
i_sgtty='$i_sgtty'
2482224710
i_shadow='$i_shadow'
2482324711
i_socks='$i_socks'
24824-
i_stdarg='$i_stdarg'
2482524712
i_stdbool='$i_stdbool'
2482624713
i_stddef='$i_stddef'
2482724714
i_stdint='$i_stdint'
@@ -24864,8 +24751,6 @@ i_unistd='$i_unistd'
2486424751
i_ustat='$i_ustat'
2486524752
i_utime='$i_utime'
2486624753
i_values='$i_values'
24867-
i_varargs='$i_varargs'
24868-
i_varhdr='$i_varhdr'
2486924754
i_vfork='$i_vfork'
2487024755
i_wchar='$i_wchar'
2487124756
i_xlocale='$i_xlocale'

Cross/config.sh-arm-linux

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,6 @@ i_rpcsvcdbm='undef'
772772
i_sgtty='undef'
773773
i_shadow='define'
774774
i_socks='undef'
775-
i_stdarg='define'
776775
i_stdbool='undef'
777776
i_stddef='define'
778777
i_stdint='define'
@@ -815,8 +814,6 @@ i_unistd='define'
815814
i_ustat='define'
816815
i_utime='define'
817816
i_values='define'
818-
i_varargs='undef'
819-
i_varhdr='stdarg.h'
820817
i_vfork='undef'
821818
i_wchar='undef'
822819
i_xlocale='undef'

Cross/config.sh-arm-linux-n770

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ i_rpcsvcdbm='undef'
632632
i_sgtty='undef'
633633
i_shadow='define'
634634
i_socks='undef'
635-
i_stdarg='define'
636635
i_stddef='define'
637636
i_stdlib='define'
638637
i_string='define'
@@ -673,8 +672,6 @@ i_unistd='define'
673672
i_ustat='define'
674673
i_utime='define'
675674
i_values='define'
676-
i_varargs='undef'
677-
i_varhdr='stdarg.h'
678675
i_vfork='undef'
679676
ignore_versioned_solibs='y'
680677
inc_version_list=' '

INSTALL

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,27 +1532,6 @@ PERL5LIB, and PERL5OPT will influence the behaviour of the test suite.
15321532
So if you are getting strange test failures, you may want to try
15331533
retesting with the various PERL variables unset.
15341534

1535-
=item varargs
1536-
1537-
If you get varargs problems with gcc, be sure that gcc is installed
1538-
correctly and that you are not passing -I/usr/include to gcc. When using
1539-
gcc, you should probably have i_stdarg='define' and i_varargs='undef'
1540-
in config.sh. The problem is usually solved by installing gcc
1541-
correctly. If you do change config.sh, don't forget to propagate
1542-
your changes (see L<"Propagating your changes to config.sh"> below).
1543-
1544-
=item util.c
1545-
1546-
If you get error messages such as the following (the exact line
1547-
numbers and function name may vary in different versions of perl):
1548-
1549-
util.c: In function 'Perl_form':
1550-
util.c:1107: number of arguments doesn't match prototype
1551-
proto.h:125: prototype declaration
1552-
1553-
it might well be a symptom of the gcc "varargs problem". See the
1554-
previous L<"varargs"> item.
1555-
15561535
=item LD_LIBRARY_PATH
15571536

15581537
If you run into dynamic loading problems, check your setting of

MANIFEST

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4452,7 +4452,6 @@ hints/esix4.sh Hints for named architecture
44524452
hints/fps.sh Hints for named architecture
44534453
hints/freebsd.sh Hints for named architecture
44544454
hints/freemint.sh Hints for named architecture
4455-
hints/genix.sh Hints for named architecture
44564455
hints/gnu.sh Hints for named architecture
44574456
hints/gnukfreebsd.sh Hints for named architecture
44584457
hints/gnuknetbsd.sh Hints for named architecture

NetWare/config.wc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,6 @@ i_rpcsvcdbm='define'
754754
i_sgtty='undef'
755755
i_shadow='undef'
756756
i_socks='undef'
757-
i_stdarg='define'
758757
i_stdbool='define'
759758
i_stddef='define'
760759
i_stdint='undef'
@@ -797,8 +796,6 @@ i_unistd='undef'
797796
i_ustat='undef'
798797
i_utime='define'
799798
i_values='undef'
800-
i_varargs='undef'
801-
i_varhdr='varargs.h'
802799
i_vfork='undef'
803800
i_wchar='undef'
804801
i_xlocale='undef'

NetWare/config_H.wc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,17 +3233,6 @@
32333233
/*#define SETUID_SCRIPTS_ARE_SECURE_NOW /**/
32343234
/*#define DOSUID /**/
32353235

3236-
/* I_STDARG:
3237-
* This symbol, if defined, indicates that <stdarg.h> exists and should
3238-
* be included.
3239-
*/
3240-
/* I_VARARGS:
3241-
* This symbol, if defined, indicates to the C program that it should
3242-
* include <varargs.h>.
3243-
*/
3244-
#define I_STDARG /**/
3245-
/*#define I_VARARGS /**/
3246-
32473236
/* USE_CROSS_COMPILE:
32483237
* This symbol, if defined, indicates that Perl is being cross-compiled.
32493238
*/

Porting/Glossary

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3601,11 +3601,6 @@ i_socks (i_socks.U):
36013601
This variable conditionally defines the I_SOCKS symbol, and indicates
36023602
whether a C program should include <socks.h>.
36033603

3604-
i_stdarg (i_varhdr.U):
3605-
This variable conditionally defines the I_STDARG symbol, which
3606-
indicates to the C program that <stdarg.h> exists and should
3607-
be included.
3608-
36093604
i_stdbool (i_stdbool.U):
36103605
This variable conditionally defines the I_STDBOOL symbol, which
36113606
indicates to the C program that <stdbool.h> exists and should
@@ -3788,14 +3783,6 @@ i_values (i_values.U):
37883783
whether a C program may include <values.h> to get symbols like MAXLONG
37893784
and friends.
37903785

3791-
i_varargs (i_varhdr.U):
3792-
This variable conditionally defines I_VARARGS, which indicates
3793-
to the C program that it should include <varargs.h>.
3794-
3795-
i_varhdr (i_varhdr.U):
3796-
Contains the name of the header to be included to get va_dcl definition.
3797-
Typically one of varargs.h or stdarg.h.
3798-
37993786
i_vfork (i_vfork.U):
38003787
This variable conditionally defines the I_VFORK symbol, and indicates
38013788
whether a C program should include vfork.h.

Porting/config.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,6 @@ i_rpcsvcdbm='undef'
790790
i_sgtty='undef'
791791
i_shadow='undef'
792792
i_socks='undef'
793-
i_stdarg='define'
794793
i_stdbool='define'
795794
i_stddef='define'
796795
i_stdint='define'
@@ -833,8 +832,6 @@ i_unistd='define'
833832
i_ustat='undef'
834833
i_utime='define'
835834
i_values='undef'
836-
i_varargs='undef'
837-
i_varhdr='stdarg.h'
838835
i_vfork='undef'
839836
i_wchar='undef'
840837
i_xlocale='define'

Porting/config_H

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,17 +2846,6 @@
28462846
*/
28472847
#define I_SYSUIO /**/
28482848

2849-
/* I_STDARG:
2850-
* This symbol, if defined, indicates that <stdarg.h> exists and should
2851-
* be included.
2852-
*/
2853-
/* I_VARARGS:
2854-
* This symbol, if defined, indicates to the C program that it should
2855-
* include <varargs.h>.
2856-
*/
2857-
#define I_STDARG /**/
2858-
/*#define I_VARARGS / **/
2859-
28602849
/* Free_t:
28612850
* This variable contains the return type of free(). It is usually
28622851
* void, but occasionally int.

cflags.SH

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ cat >_cflags.c <<__EOT__
7979
#ifdef I_STDDEF
8080
#include <stddef.h>
8181
#endif
82-
#ifdef I_STDARG
8382
#include <stdarg.h>
84-
#endif
8583
#ifdef I_LIMITS
8684
#include <limits.h>
8785
#endif

config_h.SH

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,17 +2292,6 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
22922292
#$i_termios I_TERMIOS /**/
22932293
#$i_sgtty I_SGTTY /**/
22942294
2295-
/* I_STDARG:
2296-
* This symbol, if defined, indicates that <stdarg.h> exists and should
2297-
* be included.
2298-
*/
2299-
/* I_VARARGS:
2300-
* This symbol, if defined, indicates to the C program that it should
2301-
* include <varargs.h>.
2302-
*/
2303-
#$i_stdarg I_STDARG /**/
2304-
#$i_varargs I_VARARGS /**/
2305-
23062295
/* Free_t:
23072296
* This variable contains the return type of free(). It is usually
23082297
* void, but occasionally int.

configure.com

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6579,7 +6579,6 @@ $ WC "i_rpcsvcdbm='undef'"
65796579
$ WC "i_sgtty='undef'"
65806580
$ WC "i_shadow='" + i_shadow + "'"
65816581
$ WC "i_socks='" + i_socks + "'"
6582-
$ WC "i_stdarg='define'"
65836582
$ IF ccname .EQS. "DEC" .AND. F$INTEGER(Dec_C_Version).GE.60400000
65846583
$ THEN
65856584
$ WC "i_stdbool='define'"
@@ -6627,8 +6626,6 @@ $ WC "i_unistd='" + i_unistd + "'"
66276626
$ WC "i_ustat='undef'"
66286627
$ WC "i_utime='" + i_utime + "'"
66296628
$ WC "i_values='undef'"
6630-
$ WC "i_varargs='undef'"
6631-
$ WC "i_varhdr='stdarg.h'"
66326629
$ WC "i_vfork='undef'"
66336630
$ WC "i_wchar='undef'"
66346631
$ WC "i_xlocale='undef'"

hints/genix.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

perl.h

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -693,12 +693,6 @@
693693

694694
#include <sys/types.h>
695695

696-
#ifdef __cplusplus
697-
# ifndef I_STDARG
698-
# define I_STDARG 1
699-
# endif
700-
#endif
701-
702696
/* EVC 4 SDK headers includes a bad definition of MB_CUR_MAX in stdlib.h
703697
which is included from stdarg.h. Bad definition not present in SD 2008
704698
SDK headers. wince.h is not yet included, so we cant fix this from there
@@ -708,13 +702,8 @@
708702
#if defined(UNDER_CE) && (_MSC_VER < 1300)
709703
# define MB_CUR_MAX 1
710704
#endif
711-
#ifdef I_STDARG
712-
# include <stdarg.h>
713-
#else
714-
# ifdef I_VARARGS
715-
# include <varargs.h>
716-
# endif
717-
#endif
705+
706+
# include <stdarg.h>
718707

719708
#ifdef I_STDINT
720709
# include <stdint.h>

0 commit comments

Comments
 (0)