Skip to content

C99 fixes for the configure script - #1720

Merged
jimklimov merged 2 commits into
networkupstools:masterfrom
fweimer-rh:c99
Nov 30, 2022
Merged

jimklimov merged 2 commits into
networkupstools:masterfrom
fweimer-rh:c99

Conversation

@fweimer-rh

Copy link
Copy Markdown
Contributor

Future C compilers will likely default to language modes which do not support implicit function declarations. Rebuilding nut with an instrumented compiler revealed a few issues in the configure script.

The function foo is defined in the C fragment, but the func
function is undeclared.  This avoids relying on an implicit
function declaration, a C language feature that was removed
in 1999.
Adjust quoting in the AX_C_PRINTF_STRING_NULL definition.  Switch to
strstr and include <string.h> instead of <strings.h>.  Add missing
braces and parentheses.  Use double-quote for string literals.

The test now reports success on glibc, as expected.
@fweimer-rh fweimer-rh changed the title C99 C99 fixes for the configure script Nov 27, 2022
@jimklimov jimklimov added CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings labels Nov 28, 2022
@jimklimov

Copy link
Copy Markdown
Member

Decent catches, in line with the #823 and related issues of the "fightwarn effort" that took years to brush up the codebase - thanks!

Comment thread configure.ac Resolved
@jimklimov jimklimov added this to the 2.8.1 milestone Nov 29, 2022
@jimklimov
jimklimov merged commit 04527ea into networkupstools:master Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants