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

Add dummy macros for conditionally defined macros #211

Merged
merged 3 commits into from
Feb 27, 2025

Conversation

lumynou5
Copy link
Contributor

cppcheck reports "unknownMacro" when a conditionally defined macro is used.

This patch adds dummy macros to make code pass the static analytics without other effects. The assignments and increments make cppcheck consider the variables are used to suppress potential reports about uninitialized variables, unused variables, and can-be-constant variables. The pointers with value 1 instead of NULL suppress reports about indirectly getting value of null pointers.

Closes #210.

Change-Id: Ia8db49c0c71ab82d5da10ce389f57ebb69c99051

cppcheck reports "unknownMacro" when a conditionally defined macro is
used.

This patch adds dummy macros to make code pass the static analytics
without other effects.  The assignments and increments make cppcheck
consider the variables are used to suppress potential reports about
uninitialized variables, unused variables, and can-be-constant
variables.  The pointers with value 1 instead of NULL suppress reports
about indirectly getting value of null pointers.

Closes sysprog21#210.

Change-Id: Ia8db49c0c71ab82d5da10ce389f57ebb69c99051
Change-Id: I1da359df006f058c3e27a0d4bc91b50c4441a1da
Change-Id: I85c21c24bbd5856a5a22cbd983f5150a56c13345
@jserv jserv merged commit 1d68fae into sysprog21:master Feb 27, 2025
1 of 2 checks passed
@jserv
Copy link
Contributor

jserv commented Feb 27, 2025

Thank @lumynou5 for contributing!

Mike1117 pushed a commit to Mike1117/lab0-c that referenced this pull request Feb 27, 2025
Cppcheck reports "unknownMacro" when a conditionally defined macro is
used.

This patch adds dummy macros to make code pass the static analytics
without other effects.  The assignments and increments make cppcheck
consider the variables are used to suppress potential reports about
uninitialized variables, unused variables, and can-be-constant
variables.  The pointers with value 1 instead of NULL suppress reports
about indirectly getting value of null pointers.

Closes sysprog21#210

Change-Id: Ia8db49c0c71ab82d5da10ce389f57ebb69c99051
yy214123 pushed a commit to yy214123/lab0-c that referenced this pull request Feb 27, 2025
Cppcheck reports "unknownMacro" when a conditionally defined macro is
used.

This patch adds dummy macros to make code pass the static analytics
without other effects.  The assignments and increments make cppcheck
consider the variables are used to suppress potential reports about
uninitialized variables, unused variables, and can-be-constant
variables.  The pointers with value 1 instead of NULL suppress reports
about indirectly getting value of null pointers.

Closes sysprog21#210

Change-Id: Ia8db49c0c71ab82d5da10ce389f57ebb69c99051
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.

Add dummy macros for conditionally defined macros
2 participants