-
Notifications
You must be signed in to change notification settings - Fork 262
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 many warnings in libnczarr #2852
base: main
Are you sure you want to change the base?
Changes from 5 commits
51073cb
013af12
585e322
3537781
f8da95a
0df2958
dac5355
e7c1c78
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You will note that as a rule, we always declare variables at the beginning of a block e.g. {...} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is a limitation of C89 and relaxed in C99. It's supported by every compiler on Compiler Explorer (except for a 6502 specific compiler and one for TI calculators). I would strongly suggest moving to this style when writing new code, as it can avoid bugs by reducing the scope of variables and preventing use of uninitialised values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config.h should be in zincludes.h
should this be zinfo->controls.flags &= ~((size64_t)(noflags));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, my editor automatically includes the most relevant header when inserting new types. It looks like nothing in
zincludes.h
is used directly which is probably why it chosencconfigure.h
instead.It's probably actually clearer to change the type of
noflags
itself, not sure why I didn't spot that, thanks