Ticket #61515: explicit-declarations.patch

File explicit-declarations.patch, 6.3 KB (added by larryv (Lawrence Velázquez), 4 years ago)

adaptation of upstream's fix

  • aczsh.m4

    https://sourceforge.net/p/zsh/code/ci/bd647c156549b2f666e5fae80f1ca674b6cde895/
    
        commit bd647c156549b2f666e5fae80f1ca674b6cde895
        Author: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
        Date:   Mon Nov 16 20:59:51 2020 +0900
    
            47560: add includes/prototypes for tests in configure
    
            On macOS 11.0 it is now an error to use a function without prototype.
    
    old new AC_TRY_COMMAND($DLLD -o conftest1.$DL_EX 
    118118AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AC_FD_CC) &&
    119119AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AC_FD_CC); then
    120120    AC_TRY_RUN([
     121#include <stdlib.h>
    121122#ifdef HPUX10DYNAMIC
    122123#include <dl.h>
    123124#define RTLD_LAZY BIND_DEFERRED
    AC_TRY_COMMAND($DLLD -o conftest1.$DL_EX 
    199200AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AC_FD_CC) &&
    200201AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AC_FD_CC); then
    201202    AC_TRY_RUN([
     203#include <stdlib.h>
    202204#ifdef HPUX10DYNAMIC
    203205#include <dl.h>
    204206#define RTLD_LAZY BIND_DEFERRED
    AC_TRY_COMMAND($DLLD -o conftest1.$DL_EX 
    274276AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AC_FD_CC) &&
    275277AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AC_FD_CC); then
    276278    AC_TRY_RUN([
     279#include <stdlib.h>
    277280#ifdef HPUX10DYNAMIC
    278281#include <dl.h>
    279282#define RTLD_LAZY BIND_DEFERRED
    AC_TRY_COMMAND($DLLD -o conftest1.$DL_EX 
    343346    save_ldflags=$LDFLAGS
    344347    LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
    345348    AC_TRY_RUN([
     349#include <stdlib.h>
    346350#ifdef HPUX10DYNAMIC
    347351#include <dl.h>
    348352#define RTLD_LAZY BIND_DEFERRED
    elif 
    416420    save_ldflags=$LDFLAGS
    417421    LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS -s"
    418422    AC_TRY_RUN([
     423#include <stdlib.h>
    419424#ifdef HPUX10DYNAMIC
    420425#include <dl.h>
    421426#define RTLD_LAZY BIND_DEFERRED
    echo 'int fred () { return 42; }' > conf 
    483488if AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&AC_FD_CC) &&
    484489AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS -s conftest1.o $LIBS 1>&AC_FD_CC); then
    485490    AC_TRY_RUN([
     491#include <stdlib.h>
    486492#ifdef HPUX10DYNAMIC
    487493#include <dl.h>
    488494#define RTLD_LAZY BIND_DEFERRED
  • configure

    old new else 
    88518851  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    88528852/* end confdefs.h.  */
    88538853
     8854#include <fcntl.h>
     8855#include <stdlib.h>
     8856int tgetent(char *, char *);
     8857char *tgetstr(char *, char **);
    88548858main()
    88558859{
    88568860    char buf[4096];
    else 
    88978901  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    88988902/* end confdefs.h.  */
    88998903
     8904#include <fcntl.h>
     8905#include <stdlib.h>
     8906int tgetent(char *, char*);
     8907char *tgetstr(char *, char **);
    89008908main()
    89018909{
    89028910    char buf[4096];
    else 
    98059813#include <sys/time.h>
    98069814#endif
    98079815#include <sys/resource.h>
     9816#include <stdlib.h>
    98089817main(){struct rlimit r;exit(sizeof(r.rlim_cur) <= sizeof(long));}
    98099818_ACEOF
    98109819if ac_fn_c_try_run "$LINENO"; then :
    else 
    98369845#endif
    98379846#include <stdio.h>
    98389847#include <sys/resource.h>
     9848#include <stdlib.h>
    98399849main() {
    98409850  struct rlimit r;
    98419851  char buf[20];
    else 
    98819891#include <sys/time.h>
    98829892#endif
    98839893#include <sys/resource.h>
     9894#include <stdlib.h>
    98849895  main(){struct rlimit r;r.rlim_cur=-1;exit(r.rlim_cur<0);}
    98859896_ACEOF
    98869897if ac_fn_c_try_run "$LINENO"; then :
    else 
    1166011671
    1166111672#include <fcntl.h>
    1166211673#include <signal.h>
     11674#include <unistd.h>
     11675#include <stdlib.h>
     11676#include <sys/stat.h>
    1166311677main()
    1166411678{
    1166511679    char c;
    else 
    1171811732
    1171911733#include <unistd.h>
    1172011734#include <fcntl.h>
     11735#include <stdlib.h>
    1172111736main()
    1172211737{
    1172311738    int ret;
    else 
    1176711782#include <unistd.h>
    1176811783#include <signal.h>
    1176911784#include <errno.h>
     11785#include <stdlib.h>
    1177011786main()
    1177111787{
    1177211788    int pid = (getpid() + 10000) & 0xffffff;
    else 
    1180811824
    1180911825#include <signal.h>
    1181011826#include <unistd.h>
     11827#include <stdlib.h>
    1181111828int child=0;
    1181211829void handler(sig)
    1181311830    int sig;
    else 
    1188211899#include <sys/types.h>
    1188311900#include <unistd.h>
    1188411901#include <fcntl.h>
     11902#include <stdlib.h>
    1188511903main() {
    1188611904    int fd;
    1188711905    int ret;
    else 
    1194211960/* end confdefs.h.  */
    1194311961
    1194411962#include <pwd.h>
     11963#include <stdio.h>
     11964#include <string.h>
     11965#include <stdlib.h>
     11966#include <unistd.h>
    1194511967main() {
    1194611968    struct passwd *pw1, *pw2;
    1194711969    char buf[1024], name[1024];
    else 
    1234612368/* Test for whether ELF binaries are produced */
    1234712369#include <fcntl.h>
    1234812370#include <stdlib.h>
     12371#include <unistd.h>
    1234912372main(argc, argv)
    1235012373int argc;
    1235112374char *argv[];
    else 
    1255412577/* end confdefs.h.  */
    1255512578
    1255612579#include <stdio.h>
     12580#include <stdlib.h>
    1255712581#ifdef HPUX10DYNAMIC
    1255812582#include <dl.h>
    1255912583#define RTLD_LAZY BIND_DEFERRED
    else 
    1268012704  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1268112705/* end confdefs.h.  */
    1268212706
     12707#include <stdlib.h>
    1268312708#ifdef HPUX10DYNAMIC
    1268412709#include <dl.h>
    1268512710#define RTLD_LAZY BIND_DEFERRED
    else 
    1280412829  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1280512830/* end confdefs.h.  */
    1280612831
     12832#include <stdlib.h>
    1280712833#ifdef HPUX10DYNAMIC
    1280812834#include <dl.h>
    1280912835#define RTLD_LAZY BIND_DEFERRED
    else 
    1292812954  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1292912955/* end confdefs.h.  */
    1293012956
     12957#include <stdlib.h>
    1293112958#ifdef HPUX10DYNAMIC
    1293212959#include <dl.h>
    1293312960#define RTLD_LAZY BIND_DEFERRED
    else 
    1304513072  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1304613073/* end confdefs.h.  */
    1304713074
     13075#include <stdlib.h>
    1304813076#ifdef HPUX10DYNAMIC
    1304913077#include <dl.h>
    1305013078#define RTLD_LAZY BIND_DEFERRED
    else 
    1315213180  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1315313181/* end confdefs.h.  */
    1315413182
     13183#include <stdlib.h>
    1315513184#ifdef HPUX10DYNAMIC
    1315613185#include <dl.h>
    1315713186#define RTLD_LAZY BIND_DEFERRED
    else 
    1324313272  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1324413273/* end confdefs.h.  */
    1324513274
     13275#include <stdlib.h>
    1324613276#ifdef HPUX10DYNAMIC
    1324713277#include <dl.h>
    1324813278#define RTLD_LAZY BIND_DEFERRED
    else 
    1334113371  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1334213372/* end confdefs.h.  */
    1334313373
     13374#include <stdlib.h>
    1334413375#ifdef HPUX10DYNAMIC
    1334513376#include <dl.h>
    1334613377#define RTLD_LAZY BIND_DEFERRED
    else 
    1343013461  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1343113462/* end confdefs.h.  */
    1343213463
     13464#include <stdlib.h>
    1343313465#ifdef HPUX10DYNAMIC
    1343413466#include <dl.h>
    1343513467#define RTLD_LAZY BIND_DEFERRED