branch development updated: m4: Fix Wstrict-prototypes warnings

Ileana Dumitrescu <[email protected]>
Newsgroups gmane.comp.gnu.libtool.cvs
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script.

ildumi pushed a commit to branch development
in repository libtool.

The following commit(s) were added to refs/heads/development by this push:
     new 830a79ec m4: Fix Wstrict-prototypes warnings
830a79ec is described below

commit 830a79ec29fc67e683f843285d6b68621fd353a2
Author: Peter Kokot <[email protected]>
AuthorDate: Mon Mar 18 01:28:15 2024 +0100

    m4: Fix Wstrict-prototypes warnings
    
    This changes the C function prototypes to use void where needed. When
    building with CFLAGS=-Werror=strict-prototypes or similar, the libtool's
    tests can cause false reports and errors in the log files:
    
        error: function declaration isn't a prototype
    
    * m4/libtool.m4: Specify void for main function prototypes.
    * m4/ltdl.m4: Specify void for main and fnord function prototypes.
---
 m4/libtool.m4 | 12 ++++++------
 m4/ltdl.m4    |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index bbf2d21f..71d1e1ce 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1048,7 +1048,7 @@ _LT_EOF
       echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
       $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
       cat > conftest.c << _LT_EOF
-int main() { return 0;}
+int main(void) { return 0;}
 _LT_EOF
       echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
       $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
@@ -1879,11 +1879,11 @@ else
 /* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
+int fnord (void) __attribute__((visibility("default")));
 #endif
 
-int fnord () { return 42; }
-int main ()
+int fnord (void) { return 42; }
+int main (void)
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
   int status = $lt_dlunknown;
@@ -4060,7 +4060,7 @@ void nm_test_func(void){}
 #ifdef __cplusplus
 }
 #endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
+int main(void){nm_test_var='a';nm_test_func();return(0);}
 _LT_EOF
 
   if AC_TRY_EVAL(ac_compile); then
@@ -6232,7 +6232,7 @@ _LT_TAGVAR(objext, $1)=$objext
 lt_simple_compile_test_code="int some_variable = 0;"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
+lt_simple_link_test_code='int main(void){return(0);}'
 
 _LT_TAG_COMPILER
 # Save the default compiler, since it gets overwritten when the other
diff --git a/m4/ltdl.m4 b/m4/ltdl.m4
index 548e3643..8c6222b9 100644
--- a/m4/ltdl.m4
+++ b/m4/ltdl.m4
@@ -758,7 +758,7 @@ AC_CACHE_CHECK([for _ prefix in compiled symbols],
   [lt_cv_sys_symbol_underscore=no
   cat > conftest.$ac_ext <<_LT_EOF
 void nm_test_func(){}
-int main(){nm_test_func;return 0;}
+int main(void){nm_test_func;return 0;}
 _LT_EOF
   if AC_TRY_EVAL(ac_compile); then
     # Now try to grab the symbols.
@@ -862,7 +862,7 @@ _LT_EOF
 #    define RTLD_NOW 0
 #  endif
 #endif
-int main () {
+int main (void) {
   void *handle = dlopen ("`pwd`/$libname$libltdl_cv_shlibext", RTLD_GLOBAL|RTLD_NOW);
   int status = $libltdl_dlunknown;
   if (handle) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.