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

Enable CppCheck & fix some issues it detects in the code #247

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

Conversation

hoijui
Copy link
Contributor

@hoijui hoijui commented Mar 14, 2020

No description provided.

hoijui added 4 commits March 14, 2020 20:23
…C99)

In C89, variables had to be declared at the start of a code block.
Many programmers though they have to be declared at the beginning
of a function even. by declaring variables where they are first used,
or at least at the beginning of the code block where they are used,
we give the compiler more options for optimization, while also slightly
improving code readability.

Signed-off-by: Robin Vobruba <[email protected]>
This requires CMake 3.10 or later.

Alternatively, you may run CppCheck manually like this:

    cppcheck --enable=all --std=c99 . 2>&1 \
	| grep -v " is never used." \
	| grep -v "Checking " \
	| grep -v " files checked " \
	> cppcheck.log

Signed-off-by: Robin Vobruba <[email protected]>
CMakeLists.txt Outdated Show resolved Hide resolved
thanks to ThomasFeher

Co-Authored-By: ThomasFeher <[email protected]>
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.

2 participants