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 some warnings and increase safety checking on gcc #119

Merged
merged 4 commits into from
Mar 31, 2017

Conversation

timrae
Copy link
Contributor

@timrae timrae commented Mar 31, 2017

No description provided.

timrae added 4 commits March 31, 2017 12:12
Compiling with gcc pedantic mode was leading to a warning: "type qualifiers ignored on function return type"
From the manual:
This enables some extra warning flags that are not enabled by -Wall. (This option used to be called -W. The older name is still supported, but the newer name is more descriptive.)

-Wclobbered
-Wempty-body
-Wignored-qualifiers
-Wimplicit-fallthrough=3
-Wmissing-field-initializers
-Wmissing-parameter-type (C only)
-Wold-style-declaration (C only)
-Woverride-init
-Wsign-compare (C only)
-Wtype-limits
-Wuninitialized
-Wshift-negative-value (in C++03 and in C99 and newer)
-Wunused-parameter (only with -Wunused or -Wall)
-Wunused-but-set-parameter (only with -Wunused or -Wall)
From the gcc manual:
Issue all the warnings demanded by strict ISO C and ISO C++; reject all programs that use forbidden extensions, and some other programs that do not follow ISO C and ISO C++. For ISO C, follows the version of the ISO C standard specified by any -std option used.

Note: ISO C++98 doesn't support the "long long" data type, so we disable that warning
-Winit-self can be removed as it's enabled by -Wall
@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.231% when pulling 2123ef0 on timrae:fix-warnings into 6932525 on SRombauts:master.

@timrae
Copy link
Contributor Author

timrae commented Mar 31, 2017

I'd recommend adding the -Werror flag as well so that the CI won't pass if there are any warnings

@SRombauts
Copy link
Owner

Hi, thanks for this.

I am pretty sure I started this project with -Wextra, I don't know when I would have lost it...

@SRombauts SRombauts closed this Mar 31, 2017
@SRombauts SRombauts reopened this Mar 31, 2017
@SRombauts SRombauts merged commit c6dc1c7 into SRombauts:master Mar 31, 2017
@timrae timrae deleted the fix-warnings branch March 31, 2017 05:27
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.

3 participants