Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix compiler warning in libcurl.m4 #10710

Closed
wants to merge 1 commit into from

Conversation

Karlson2k
Copy link
Contributor

Current test for curl_free() may produce warnings with strict compiler flags or even with default compiler flags with upcoming versions like this:

configure:38960: checking for curl_free
configure:38960: clang-17 -o conftest -fno-strict-aliasing -O0 -Wall -Wnull-dereference -Wdeclaration-after-statement -Wimplicit -Wnested-externs -Wredundant-decls -Wpoison-system-directories -ggdb3 -Wextra -Wdouble-promotion -Wformat=2 -Wno-format-nonliteral -Wformat-security -Wmissing-include-dirs -Wfloat-equal -Wshadow -Wpointer-arith -Wshadow-all -Wbad-function-cast -Wcast-qual -Wwrite-strings -Wconversion -Wcast-align -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-declarations -Wmissing-prototypes -Wuninitialized -Winit-self -Wshift-negative-value -Wswitch-enum -Wstrict-overflow=4 -Walloca -Warray-bounds -Wpacked -Wvariadic-macros -Wundef -Wanon-enum-enum-conversion -Warray-bounds-pointer-arithmetic -Wassign-enum -Wbit-int-extension -Wbitfield-enum-conversion -Wparentheses -Wbool-operation -Wcast-function-type -Wcomma -Wcomment -Wcompound-token-split -Wconditional-uninitialized -Wdeprecated -Wdocumentation-pedantic -Wempty-init-stmt -Wenum-conversion -Wexpansion-to-defined -Wflexible-array-extensions -Wloop-analysis -Wformat-pedantic -Wformat-type-confusion -Wfour-char-constants -Wgcc-compat -Wgnu-anonymous-struct -Wgnu-compound-literal-initializer -Wgnu-conditional-omitted-operand -Wgnu-designator -Wgnu-empty-initializer -Wgnu-empty-struct -Wgnu-flexible-array-initializer -Wgnu-folding-constant -Wgnu-null-pointer-arithmetic -Wgnu-pointer-arith -Wgnu-redeclared-enum -Wgnu-union-cast -Wgnu-variable-sized-type-not-at-end -Widiomatic-parentheses -Wmissing-noreturn -Wmissing-variable-declarations -Wnested-anon-types -Wnewline-eof -Wover-aligned -Wredundant-parens -Wshift-sign-overflow -Wtautological-compare -Wunaligned-access -Wunused -Wzero-as-null-pointer-constant -Wzero-length-array -Wused-but-marked-unused   -D_GNU_SOURCE -D_XOPEN_SOURCE=700   -Wl,--warn-common  conftest.c  -lcurl >&5
conftest.c:127:16: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
char curl_free ();
               ^
                void
1 warning generated.
configure:38960: $? = 0
configure:38960: result: yes

These warning could turned into errors by -Werror or similar flags.
Such warnings/errors are avoided by this patch.

With this patch the check is based on header, not libcurl binary, but having different versions of libcurl binary and libcurl header could easily lead to many various problems, so quick failure on build-time (if curl_free() is present in header, but absent in the library binary) could be a better option then hard-to-debug failures on run-time.

Current test for curl_free() may produce warnings with strict compiler
flags or even with default compiler flags with upcoming versions.
These warning could turned into errors by -Werror or similar flags.
Such warnings/errors are avoided by this patch.
@bagder
Copy link
Member

bagder commented Mar 8, 2023

Thanks!

@bagder bagder closed this in 372b95f Mar 8, 2023
@Karlson2k Karlson2k deleted the fix_libcurl_m4 branch March 17, 2023 07:10
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
Current test for curl_free() may produce warnings with strict compiler
flags or even with default compiler flags with upcoming versions.
These warning could turned into errors by -Werror or similar flags.
Such warnings/errors are avoided by this patch.

Closes curl#10710
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants