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

Fix compiler warnings #3839

Closed
wants to merge 2 commits into from
Closed

Fix compiler warnings #3839

wants to merge 2 commits into from

Conversation

meenavyas
Copy link
Contributor

@meenavyas meenavyas commented Jul 4, 2017

I get the following error when I use gcc 4.4.7 with Travis YML plugin and Jenkins :

gcc -Icrypto/include -Iinclude -I../_srcdist/crypto/include -I../_srcdist/include -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSLDIR=""/usr/local/ssl"" -DENGINESDIR=""/usr/local/lib64/engines-1.1"" -Wall -O3 -pthread -m64 -DL_ENDIAN -DDEBUG_UNUSED -Wswitch -DPEDANTIC -pedantic -Wno-long-long -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Wtype-limits -Wundef -Werror -MMD -MF test/ct_test.d.tmp -MT test/ct_test.o -c -o test/ct_test.o ../_srcdist/test/ct_test.c
cc1: warnings being treated as errors
../_srcdist/test/ct_test.c: In function 'test_ctlog_from_base64':
../_srcdist/test/ct_test.c:491: error: declaration of 'log' shadows a global declaration
/usr/include/bits/mathcalls.h:110: error: shadowed declaration is here
make[1]: *** [test/ct_test.o] Error 1

This patch fixes the problem.

@dot-asm
Copy link
Contributor

dot-asm commented Jul 4, 2017

Customarily it's argued (well, at least I for one do) that this is compiler bug in warning subsystem. I mean warning about shadowing a variable is useful, but warning about shadowing function is not, essentially counter-productive. And this was apparently recognized as bug, because for example gcc 3.x complains about it, so does 4.6, but not 4.8. And question in the context is, if it's compiler bug, then do we actually have to work around it? However, if we choose to, I'd argue that ctlogp would probably be better replacement name for variable in question...

@paulidale
Copy link
Contributor

The change that added this went in on the 10th of June this year so it is recent rather than dusty. Perhaps renaming the variable is prudent. I agree that ctlogp is a better name.

@t-j-h
Copy link
Member

t-j-h commented Jul 5, 2017

+1 @pauli if you want to change to ctlogp

Copy link
Contributor

@paulidale paulidale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge

@paulidale paulidale self-assigned this Jul 5, 2017
levitte pushed a commit that referenced this pull request Jul 5, 2017
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from #3839)
@paulidale
Copy link
Contributor

Thanks.

@paulidale paulidale closed this Jul 5, 2017
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

Successfully merging this pull request may close these issues.

None yet

4 participants