From 71da92d4f750b38420e929e4cafd98436ccf2a1c Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Dec 09 2022 19:11:44 +0000 Subject: Minor fixes for C99 compatibility Related to: --- diff --git a/bigloo-bde-bmem-c99.patch b/bigloo-bde-bmem-c99.patch new file mode 100644 index 0000000..3feec1a --- /dev/null +++ b/bigloo-bde-bmem-c99.patch @@ -0,0 +1,28 @@ +This patch is an actual bug fix because the implicit declarations in +bde/bmem/lib/mem.c to these functions refer to functions, not function +pointers, so it's not clear how this could have ever worked. + +Upstream fixed this differently, by rewriting the code: + +commit d315487d6a97ef7b4483e919d1823a408337bd07 +Author: Manuel Serrano +Date: Sun Dec 5 10:31:57 2021 +0100 + + New bmem memory profiler + +diff -ur bde/bmem/lib/bmem.h bde/bmem/lib/bmem.h +--- bde/bmem/lib/bmem.h 2022-01-04 08:38:56.000000000 +0100 ++++ bmem/lib/bmem.h 2022-12-09 19:41:33.804588236 +0100 +@@ -123,6 +123,12 @@ + extern void *(*____string_to_llong)( char * ); + extern void *(*____string_to_elong)( char * ); + ++extern void *(*____create_vector)( int ); ++extern void *(*____create_vector_uncollectable)( int ); ++ ++extern void *(*____make_fx_procedure)( void *(*)(), int, int ); ++extern void *(*____make_va_procedure)( void *(*)(), int, int ); ++ + extern void *(*____bgl_make_output_port)( void *, bgl_stream_t, int, void *, void *, ssize_t (*)(), long (*)(), int (*)() ); + + extern void *(*____bgl_output_port_timeout_set)( void *, long ); diff --git a/bigloo-configure-c99.patch b/bigloo-configure-c99.patch new file mode 100644 index 0000000..175091c --- /dev/null +++ b/bigloo-configure-c99.patch @@ -0,0 +1,307 @@ +commit 85aed0c60431104446bb904d44066be0bae225d1 +Author: Jerry James +Date: Tue Nov 22 08:56:51 2022 -0700 + + Migrate K&R C in the config scripts to ANSI C + +diff --git autoconf/alsa autoconf/alsa +index 028a1979..3d354afb 100755 +--- autoconf/alsa ++++ autoconf/alsa +@@ -72,6 +72,7 @@ cat > $file.c < + #include + + static char *device = "default"; /* playback device */ +diff --git autoconf/ccoptim autoconf/ccoptim +index 297fafdc..117bbb39 100755 +--- autoconf/ccoptim ++++ autoconf/ccoptim +@@ -85,6 +85,8 @@ fi + #* allocations. We try to detect this in the Bigloo configuration. */ + #*---------------------------------------------------------------------*/ + cat > $file2.c < $file.c < + +-main( argc, argv ) +-int argc; +-char *argv[]; ++int main( int argc, char *argv[] ) + { + extern char **environ; + return (environ != 0) && (&execv != 0); +diff --git autoconf/gccattrs autoconf/gccattrs +index 592b525d..1b2a56d0 100755 +--- autoconf/gccattrs ++++ autoconf/gccattrs +@@ -73,7 +73,7 @@ __malloc void *foo() { + return malloc( 10 ); + } + +-__noreturn stop() { ++__noreturn void stop() { + exit( 0 ); + } + +diff --git autoconf/gchavedoblocking autoconf/gchavedoblocking +index 111ff9c7..6374a0fe 100755 +--- autoconf/gchavedoblocking ++++ autoconf/gchavedoblocking +@@ -74,7 +74,7 @@ int check_addr( long a1, long a2 ) { + return a1 > a2; + } + +-main( int argc, char *argv[] ) { ++int main( int argc, char *argv[] ) { + GC_init(); + if( check_addr( &GC_do_blocking, &main ) ) puts( "yes" ); else puts( "yes" ); + return 0; +diff --git autoconf/gchavestartblocking autoconf/gchavestartblocking +index f85f16c8..1c9bc0b0 100755 +--- autoconf/gchavestartblocking ++++ autoconf/gchavestartblocking +@@ -70,7 +70,7 @@ cat > $file.c < + extern GC_start_blocking(); + +-main( int argc, char *argv[] ) { ++int main( int argc, char *argv[] ) { + GC_init(); + if( GC_start_blocking() ) puts( "yes" ); else puts( "yes" ); + return 0; +diff --git autoconf/getaddrinfo autoconf/getaddrinfo +index bf035e71..130e0c29 100755 +--- autoconf/getaddrinfo ++++ autoconf/getaddrinfo +@@ -75,8 +75,9 @@ cat > $file.c < + #endif ++#include + +-main( int argc, char *argv[] ) { ++int main( int argc, char *argv[] ) { + int status; + struct addrinfo hints; + struct addrinfo *res, *rp; +diff --git autoconf/gethwaddrs autoconf/gethwaddrs +index 7ecd0330..94f8fa11 100755 +--- autoconf/gethwaddrs ++++ autoconf/gethwaddrs +@@ -58,6 +58,8 @@ fi + #*---------------------------------------------------------------------*/ + cat > $file.c < ++#include ++#include + #include + #include + #include +diff --git autoconf/inet_aton autoconf/inet_aton +index 6b4abb92..d9758957 100755 +--- autoconf/inet_aton ++++ autoconf/inet_aton +@@ -72,8 +72,9 @@ cat > $file.c < + #include ++#include + +-main( int argc, char *argv[] ) { ++int main( int argc, char *argv[] ) { + return (inet_aton( "127.0.0.1", (void *)argv ) > 0); + } + EOF +diff --git autoconf/inet_pton autoconf/inet_pton +index 47d71f3c..a101968b 100755 +--- autoconf/inet_pton ++++ autoconf/inet_pton +@@ -81,8 +81,9 @@ cat > $file.c < + #include ++#include + +-main( int argc, char *argv[] ) { ++int main( int argc, char *argv[] ) { + return (inet_pton( AF_INET, "127.0.0.1", (void *)argv ) > 0); + } + EOF +diff --git autoconf/jartest autoconf/jartest +index 2ba133ca..ec8469c0 100755 +--- autoconf/jartest ++++ autoconf/jartest +@@ -61,9 +61,8 @@ fi + #* Test */ + #*---------------------------------------------------------------------*/ + cat > $file.txt < ++int main( int argc, char *argv[] ) + { + exit( 0 ); + } +diff --git autoconf/openssl-tls13 autoconf/openssl-tls13 +index 0981d682..c3a781ea 100755 +--- autoconf/openssl-tls13 ++++ autoconf/openssl-tls13 +@@ -68,6 +68,7 @@ cat > $file.c < + + static SSL_CTX *ctx; ++extern const SSL_METHOD *TLSv1_3_client_method(void); + + int main( int argc, char *argv[] ) { + BIO *sbio; +diff --git autoconf/openssl-v2 autoconf/openssl-v2 +index 5e065cc3..9dbaa243 100755 +--- autoconf/openssl-v2 ++++ autoconf/openssl-v2 +@@ -68,6 +68,7 @@ cat > $file.c < + + static SSL_CTX *ctx; ++const SSL_METHOD *SSLv2_server_method(void); + + int main( int argc, char *argv[] ) { + BIO *sbio; +diff --git autoconf/openssl-v3 autoconf/openssl-v3 +index ab4a6a34..bb6f1678 100755 +--- autoconf/openssl-v3 ++++ autoconf/openssl-v3 +@@ -68,6 +68,7 @@ cat > $file.c < + + static SSL_CTX *ctx; ++const SSL_METHOD *SSLv3_server_method(void); + + int main( int argc, char *argv[] ) { + BIO *sbio; +diff --git autoconf/ptrsize autoconf/ptrsize +index da2ff8c2..06354f4b 100755 +--- autoconf/ptrsize ++++ autoconf/ptrsize +@@ -50,7 +50,8 @@ fi + #* Test */ + #*---------------------------------------------------------------------*/ + cat > $file.c < ++int main () { printf( "%zu\n", sizeof( int * ) ); } + EOF + + #*---------------------------------------------------------------------*/ +diff --git autoconf/sendfile autoconf/sendfile +index 5ab5e0ca..11209262 100755 +--- autoconf/sendfile ++++ autoconf/sendfile +@@ -104,9 +104,7 @@ cat > $file.c < + #include + +-main( argc, argv ) +-int argc; +-char *argv[]; ++int main( int argc, char *argv[] ) + { + char buffer [50]; + FILE *fd = fopen( "/etc/hosts", "r" ); +diff --git autoconf/setsockopt autoconf/setsockopt +index 7c48286f..4cc152b1 100755 +--- autoconf/setsockopt ++++ autoconf/setsockopt +@@ -77,7 +77,7 @@ cat > $file.c < + #include + +-main( int argc, char *argv[] ) { ++int main( int argc, char *argv[] ) { + int s = socket( AF_INET, SOCK_STREAM, 0 ); + int sock_opt = 1; + +diff --git autoconf/socket autoconf/socket +index 5bf55d71..8eb188aa 100755 +--- autoconf/socket ++++ autoconf/socket +@@ -68,10 +68,12 @@ cat > $file.c < + #endif ++#include ++extern int gethostbyname(const char *); ++extern int getsockname(long, long, long); ++extern int accept(long, long, long); + +-main( argc, argv ) +-int argc; +-char *argv[]; ++int main( int argc, char *argv[] ) + { + printf( "%d\n", gethostbyname( "toto" ) ); + printf( "%8x\n", getsockname( 0L, 0L, 0L ) ); +diff --git autoconf/socklen autoconf/socklen +index 775b11b5..bec90627 100755 +--- autoconf/socklen ++++ autoconf/socklen +@@ -72,7 +72,7 @@ cat > $file.c < + #endif + +-main( int argc, char *argv[] ) { ++int main( int argc, char *argv[] ) { + printf( "%d\n", (socklen_t)argc ); + return 0; + } +diff --git autoconf/unixsocket autoconf/unixsocket +index 231dc5bf..973409c6 100755 +--- autoconf/unixsocket ++++ autoconf/unixsocket +@@ -77,7 +77,7 @@ cat > $file.c < + #include + +-main( int argc, char *argv[] ) { ++int main( int argc, char *argv[] ) { + int s; + struct sockaddr_un saddr; + +@@ -85,6 +85,7 @@ main( int argc, char *argv[] ) { + + strcpy( saddr.sun_path, "/tmp/foo" ); + connect( s, (struct sockaddr *)&saddr, sizeof( saddr ) ); ++ return 0; + } + EOF + +diff --git autoconf/ziptest autoconf/ziptest +index 02cc1893..bd7af72d 100755 +--- autoconf/ziptest ++++ autoconf/ziptest +@@ -61,9 +61,8 @@ fi + #* Test */ + #*---------------------------------------------------------------------*/ + cat > $file.txt < ++int main( int argc, char *argv[] ) + { + exit( 0 ); + } diff --git a/bigloo.spec b/bigloo.spec index 9552dea..0566a4e 100644 --- a/bigloo.spec +++ b/bigloo.spec @@ -37,7 +37,7 @@ Name: bigloo Version: 4.4c -Release: 8%{?patch_ver:.%{patch_ver}}%{?prerel:.%{prerel}}%{?dist} +Release: 9%{?patch_ver:.%{patch_ver}}%{?prerel:.%{prerel}}%{?dist} Summary: A compiler for the Scheme programming language # The compiler and tools are GPL-2.0-or-later. @@ -75,6 +75,9 @@ Patch9: %{name}-java-signum.patch # Allow building with Emacs 28 Patch10: %{name}-emacs28.patch +Patch11: %{name}-configure-c99.patch +Patch12: %{name}-bde-bmem-c99.patch + BuildRequires: emacs BuildRequires: gcc BuildRequires: gcc-c++ @@ -327,6 +330,9 @@ make test %changelog +* Fri Dec 9 2022 Florian Weimer - 4.4c-9.4 +- Minor fixes for C99 compatibility + * Tue Sep 13 2022 Michel Alexandre Salim - 4.4c-8.4 - Rebuilt for flac 1.4.0