Opened 4 years ago

Closed 4 years ago

#62262 closed defect (fixed)

nagios-plugins @2.3.3: error: implicit declaration of function 'min_state' is invalid in C99

Reported by: MichalMMac (Michal Moravec) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: bigsur catalina Cc:
Port: nagios-plugins

Description

There are no prebuilt packages of nagios-plugins 2.3.3 port yet -> When running port install nagios-plugins build from source is attempted.

Build from source fails in configure phase with:

:info:build check_disk.c:413:23: error: implicit declaration of function 'min_state' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
:info:build         temp_result = min_state(temp_result, temp_result2);
:info:build                       ^
:info:build check_disk.c:426:23: error: implicit declaration of function 'min_state' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
:info:build         temp_result = min_state(temp_result, temp_result2);
:info:build                       ^
:info:build check_disk.c:439:23: error: implicit declaration of function 'min_state' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
:info:build         temp_result = min_state(temp_result, temp_result2);
:info:build                       ^

See the attached log.

Tested with macOS 11.2.1 with Xcode 12.4

Attachments (4)

log.txt (334.8 KB) - added by MichalMMac (Michal Moravec) 4 years ago.
atempt-2020-2-11.txt (56.2 KB) - added by MichalMMac (Michal Moravec) 4 years ago.
atempt-2020-2-12.txt (10.1 KB) - added by MichalMMac (Michal Moravec) 4 years ago.
atempt-2020-2-12-2.txt (57.5 KB) - added by MichalMMac (Michal Moravec) 4 years ago.

Download all attachments as: .zip

Change History (10)

Changed 4 years ago by MichalMMac (Michal Moravec)

Attachment: log.txt added

comment:1 Changed 4 years ago by MichalMMac (Michal Moravec)

Looks like min_state() is declaration is missing in utils.h header file.

Also port must be built with SYSTEM_VERSION_COMPAT=1 on Big Sur.

After manually "fixing" these two issue, it builds.

comment:2 Changed 4 years ago by MichalMMac (Michal Moravec)

comment:3 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

In bcd431f9dd4c19953b8755f2f76eb9856744c3ee/macports-ports (master):

nagios-plugins: Fix implicit declarations

See: #62262

comment:4 in reply to:  1 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: bigsur catalina added
Owner: set to ryandesign
Status: newaccepted

Replying to MichalMMac:

Looks like min_state() is declaration is missing in utils.h header file.

Thank you for reporting this and for pointing us to the upstream pull request. This issue would affect Catalina and later systems using Xcode 12 and later. I've applied this patch to our port.

Also port must be built with SYSTEM_VERSION_COMPAT=1 on Big Sur.

The build succeeded without this change:

https://build.macports.org/builders/ports-11_arm64-builder/builds/11854

Why did you think it was necessary?

comment:5 Changed 4 years ago by MichalMMac (Michal Moravec)

I am not able to reproduce necessity of SYSTEM_VERSION_COMPAT=1 on my primary machine (11.12.1 with both Xcode a CLI tools installed. Tools path pointing to /Applications/Xcode.app/Contents/Developer )

However on macOS 11.1 with only CLI tools installed unless I use SYSTEM_VERSION_COMPAT=1 build fails. Build logs in attachments. I am going to upgrade this system to 11.2.1 and see if it changes anything.

Changed 4 years ago by MichalMMac (Michal Moravec)

Attachment: atempt-2020-2-11.txt added

Changed 4 years ago by MichalMMac (Michal Moravec)

Attachment: atempt-2020-2-12.txt added

Changed 4 years ago by MichalMMac (Michal Moravec)

Attachment: atempt-2020-2-12-2.txt added

comment:6 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed
Summary: nagios-plugins install broken on Big Surnagios-plugins @2.3.3: error: implicit declaration of function 'min_state' is invalid in C99

Your config.log shows the error was:

configure:3628: checking whether the C compiler works
configure:3650: /usr/bin/clang -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64 conftest.c  >&5
clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11.1'

I believe we had figured out elsewhere that you will see this error when using a version of Xcode and/or the command line tools that is too old. So we'll call this fixed, and you should update your Xcode and/or CLT to versions that are compatible with the version of macOS you run.

Note: See TracTickets for help on using tickets.