Fixed most compiler warnings -Wall -Wextra#78
Merged
Conversation
repro: CFLAGS="-Wall -Wextra -Wunused-parameter -Wc++-compat" ./configure && make which we use for perl, and libyaml is now included in cperl. Tested with gcc-5 and clang-3.7 There are still a tons of format warnings (%d on 64bit) in example-deconstructor.c which I skipped.
jcfr
reviewed
Dec 6, 2017
| * but serve no purpose inside. Silence compiler warnings. */ | ||
| #define SHIM(a) /*@unused@*/ a __attribute__unused__ | ||
|
|
||
| /* UNUSED_PARAM() marks a shim argument in the body to silence compiler warnings */ |
jcfr
reviewed
Dec 6, 2017
|
|
||
| /* Shim arguments are arguments that must be included in your function, | ||
| * but serve no purpose inside. Silence compiler warnings. */ | ||
| #define SHIM(a) /*@unused@*/ a __attribute__unused__ |
Contributor
There was a problem hiding this comment.
SHIM -> YAML_UNUSED_ATTRIBUTE (or similar name) ?
jcfr
reviewed
Dec 6, 2017
| /* Strict C compiler warning helpers */ | ||
|
|
||
| #if defined(__clang__) || defined(__GNUC__) | ||
| # define HASATTRIBUTE_UNUSED |
Contributor
There was a problem hiding this comment.
HASATTRIBUTE_UNUSED -> YAML_HASATTRIBUTE_UNUSED
jcfr
reviewed
Dec 6, 2017
| # define HASATTRIBUTE_UNUSED | ||
| #endif | ||
| #ifdef HASATTRIBUTE_UNUSED | ||
| # define __attribute__unused__ __attribute__((__unused__)) |
Contributor
There was a problem hiding this comment.
__attribute__unused__ -> YAML_ATTRIBUTE_UNUSED ?
Contributor
|
Beside of few nitpicks, looks good. |
sigmavirus24
approved these changes
Dec 10, 2017
Contributor
sigmavirus24
left a comment
There was a problem hiding this comment.
@jcfr I appreciate the review. Please keep in mind, your comments are for yaml_private.h header so I don't think we need to worry about naming for export. Cheers
ingydotnet
approved these changes
Dec 30, 2017
Member
ingydotnet
left a comment
There was a problem hiding this comment.
I like it. Thanks for doing this @perlpunk.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I took @rurban's Pull Request #27 and rebased it to master.
Then I cherry-picked this commit. Maybe this makes it easier
to review.