Skip to content

Conversation

@ryandesign
Copy link

On macOS with the clang compiler from Xcode 12 or later, the configure script gets the wrong answer when checking if signal handlers must be reinstalled when invoked because the test uses exit without including stdlib.h where it's defined. Clang in Xcode 12 and later considers implicit declaration of function to be an error. Fix it by using return instead of exit.

On macOS with the clang compiler from Xcode 12 or later, the configure
script gets the wrong answer when checking if signal handlers must be
reinstalled when invoked because the test uses exit without including
stdlib.h where it's defined. Clang in Xcode 12 and later considers
implicit declaration of function to be an error. Fix it by using return
instead of exit.
@ryandesign
Copy link
Author

Using a new compiler like clang 20 reveals more problems:

configure:7331: checking if signal handlers must be reinstalled when invoked
configure:7385: ccache /opt/local/bin/clang-mp-20 -o conftest -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -I/opt/local/libexec/llvm-3.4/include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -L/opt/local/libexec/llvm-3.4/lib -L/opt/local/lib -Wl,-headerpad_max_install_names -stdlib=libc++ -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 conftest.c -liconv -lm -lmpfr -lgmp  >&5
clang: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
conftest.c:73:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
   73 | set_signal_handler(sig, handler)
      | ^
conftest.c:89:1: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
   89 | sigint(s)
      | ^
conftest.c:94:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
   94 | main()
      | ^
      | int
2 warnings and 1 error generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant