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

Fixed pedantic toolchain warnings. #229

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

malyjak
Copy link

@malyjak malyjak commented Oct 5, 2021

Our toolchain is very pedantic. I fixed several issues it pointed out.

Copy link

@pantoniou pantoniou left a comment

Choose a reason for hiding this comment

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

Minor changes requested to get rid of casts. Otherwise looks good.

tests/run-dumper.c Outdated Show resolved Hide resolved
tests/run-emitter.c Outdated Show resolved Hide resolved
@@ -184,7 +189,7 @@ int check_boms(void)
failed++;
}
else {
if (parser.unread != check) {
if ((int)parser.unread != check) {

Choose a reason for hiding this comment

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

Same here, avoid casts.

Copy link
Author

Choose a reason for hiding this comment

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

The cast still needs to be there, to avoid compiler warnings. However, I improved the logic. Please see the new line 187.

src/api.c Outdated
@@ -121,7 +121,7 @@ yaml_stack_extend(void **start, void **top, void **end)
void *new_start;

if ((char *)*end - (char *)*start >= INT_MAX / 2)
return 0;
return 0;
Copy link

Choose a reason for hiding this comment

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

Isn't the indent broken?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, it is. Another reason to fully use 4 spaces / tab / {}, so autoformating tools will not struggle

@JKorbelRA
Copy link

JKorbelRA commented Oct 19, 2022

Can this go into the master yet? Is there still something remaining, @nobu @pantoniou ? I can help/fix that, if needed.

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.

4 participants