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

tool_help.c compilation failure: error: implicit declaration of function ‘strcasecmp’; did you mean ‘strncmp’? #3715

Closed
wyattoday opened this issue Mar 29, 2019 · 2 comments

Comments

@wyattoday
Copy link
Contributor

commented Mar 29, 2019

I did this

Compile curl using gcc 8.2.1. (using x86 compiler, but it doesn't matter)

I expected the following

Successful build.

curl/libcurl version

7.64.1

operating system

CentOS 6.

The build failed when compiling "tool_help.c":

tool_help.c: In function ‘featcomp’:
tool_help.c:553:10: error: implicit declaration of function ‘strcasecmp’; did you mean ‘strncmp’? [-Werror=implicit-function-declaration]
   return strcasecmp(* (char * const *) p1, * (char * const *) p2);
          ^~~~~~~~~~
          strncmp
cc1: some warnings being treated as errors

Bug was introduced in this PR: #3611

Solution: add #include <strings.h> above the "memdebug.h" include.

@bagder bagder added the build label Mar 29, 2019
@bagder

This comment has been minimized.

Copy link
Member

commented Mar 29, 2019

Curious that the CI builds nor my own builds get this... ?

@wyattoday

This comment has been minimized.

Copy link
Contributor Author

commented Mar 29, 2019

Maybe your CI servers don't treat that warning as an error (implicit-function-declaration).

The toolset we use is based on the Redhat compilation of the gcc toolset (basically what amounts to devtoolset-8). My guess is they have -Werror=implicit-function-declaration set by default (seeing as they recommend it as a default)

bagder added a commit that referenced this issue Mar 30, 2019
Reported-by: Wyatt O'Day
Fixes #3715
@bagder bagder closed this in fabd61f Mar 31, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.