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

Unused functions base64_decode, b64reverse. #104

Closed
deltaluca opened this issue Apr 17, 2015 · 5 comments
Closed

Unused functions base64_decode, b64reverse. #104

deltaluca opened this issue Apr 17, 2015 · 5 comments

Comments

@deltaluca
Copy link

I like to compile with warnings as errors and as many warnings turned on as possible :) It likes to tell me off for unused functions (like these two)

@bel2125
Copy link
Member

bel2125 commented Apr 17, 2015

base64_decode is called when you compile with Lua support, and b64reverse is called by base64_decode:
https://github.com/bel2125/civetweb/blob/master/src/mod_lua.inl#L666

Your linker will eliminate unused functions if you do not compile WITH_LUA

@kainjow
Copy link
Contributor

kainjow commented Apr 17, 2015

Maybe surround it with #ifdef WITH_LUA ?

@bel2125
Copy link
Member

bel2125 commented Apr 17, 2015

Yes, this would eliminate the warning if you build an EXE without Lua. In the moment it happens to be that it is not needed when you compile with websocket but without Lua.

But honestly, do you think a system built with like 10 different compilers and operating systems, dozens of WITH_SOMETHING combinations and multiple contributors should compile in all these hundreds of combinations warning free without hundreds of #ifdefs that would finally make the code unmaintainable?
An unused function is probably one of the lowest priority warnings.

bel2125 added a commit that referenced this issue Apr 17, 2015
@bel2125
Copy link
Member

bel2125 commented Apr 17, 2015

Now the following commands compile without warning on gcc 4.9.1 on Ubuntu Linux 14.10

make
make WITH_WEBSOCKET=1
make WITH_IPV6=1
make WITH_WEBSOCKET=1 WITH_IPV6=1

WITH_LUA=1 gives a few warnings from third party components (Lua, sqlite) that I will definitely NOT fix - this has to be done by the programmers of the third party modules.

I can not guarantee for any other compiler, any other operating system including different Linux distribution, not even different versions of gcc or different Ubuntu versions. And from time to time merges from other contributors may introduce warnings again, since I merge valuable improvements even if they have some warnings on some compilers the contributors probably does not use himself.

@bel2125
Copy link
Member

bel2125 commented May 10, 2015

These two warnings do no longer occur.
In general, I will have a look at all remaining warnings, once the build system with cmake (#94) is ready.

@bel2125 bel2125 closed this as completed May 10, 2015
hunyadi-dev pushed a commit to hunyadi-dev/civetweb that referenced this issue Dec 18, 2020
Logger pattern specification and atomic logger delegate

This closes civetweb#104.

Signed-off-by: Aldrin Piri <aldrin@apache.org>
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

No branches or pull requests

3 participants