bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #65762] configure check has erroneous code


From: Eli Schwartz
Subject: [bug #65762] configure check has erroneous code
Date: Mon, 20 May 2024 00:00:37 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?65762>

                 Summary: configure check has erroneous code
                   Group: GNU roff
               Submitter: eschwartz
               Submitted: Mon 20 May 2024 04:00:37 AM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 20 May 2024 04:00:37 AM UTC By: Eli Schwartz <eschwartz>
commit faff60c2bd487bb47b8988e0a18e8ee2f7371bdd
Author:     Werner LEMBERG <wl@gnu.org>
AuthorDate: Wed Nov 12 09:42:31 2003
Commit:     Werner LEMBERG <wl@gnu.org>
CommitDate: Wed Nov 12 09:42:31 2003

    LynxOS 4.0.0 has snprintf (without declaration) but no vsnprintf.



In this commit, the following change was made:

-AC_DEFUN(GROFF_WCOREFLAG,
-[AC_MSG_CHECKING([w_coredump])
-AC_TRY_RUN([#include <sys/types.h>
+AC_DEFUN([GROFF_WCOREFLAG],
+  [AC_MSG_CHECKING([w_coredump])
+   AC_RUN_IFELSE([
+       AC_LANG_PROGRAM([[
+
+#include <sys/types.h>
 #include <sys/wait.h>
+
+       ]],
+       [[
+
 main()
 {


AC_LANG_PROGRAM expects its contents to fit inside of a main() function,
though.


Detected because clang logs an interesting claim that this fails due to
implicit function declarations:

configure:28660: checking w_coredump
configure:28698: clang -o conftest -march=native -fstack-protector-all -O2
-pipe -fdiagnostics-color=always -frecord-gcc-switches   -Wformat
-Werror=format-security -Werror=implicit-function
-declaration -Werror=implicit-int -Werror=int-conversion
-Werror=incompatible-pointer-types  -Wl,-O1 -Wl,--as-needed 
-Wl,--defsym=__gentoo_check_ldflags__=0 conftest.c  >&5
conftest.c:189:7: error: expected ';' after expression
  189 | main()
      |       ^
      |       ;
conftest.c:192:3: error: call to undeclared library function 'exit' with type
'void (int) __attribute__((noreturn))'; ISO C99 and later do not support
implicit function declarations [-Wimpli
cit-function-declaration]
  192 |   exit(1);
      |   ^
conftest.c:192:3: note: include the header <stdlib.h> or explicitly provide a
declaration for 'exit'
2 errors generated.
configure:28698: $? = 1


GCC still fails, just without the false positive:


configure:28660: checking w_coredump
configure:28698: x86_64-pc-linux-gnu-gcc -o conftest -march=native
-fstack-protector-all -O2 -pipe -fdiagnostics-color=always
-frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch
-Werror=strict-aliasing  -Wformat -Werror=format-security
-Werror=implicit-function-declaration -Werror=implicit-int
-Werror=int-conversion -Werror=incompatible-pointer-types  -Wl,-O1
-Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch
-Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 conftest.c 
>&5
conftest.c: In function 'main':
conftest.c:191:7: error: expected ';' before '{' token
  191 | main()
      |       ^
      |       ;
  192 | {
      | ~      
configure:28698: $? = 1



cf. https://bugs.gentoo.org/923308







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65762>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]