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

light: the source file failed on cppcheck #156

Open
yorkie opened this issue Dec 25, 2018 · 0 comments
Open

light: the source file failed on cppcheck #156

yorkie opened this issue Dec 25, 2018 · 0 comments
Labels

Comments

@yorkie
Copy link
Member

yorkie commented Dec 25, 2018

The light currently are not friend to cppcheck, this needs to be refactored. The current error are:

ERROR= <error id="unreachableCode" severity="style" msg="Statements following return, break, continue, goto or throw will never be executed." verbose="Statements following return, break, continue, goto or throw will never be executed." cwe="561">
        <error id="unreachableCode" severity="style" msg="Statements following return, break, continue, goto or throw will never be executed." verbose="Statements following return, break, continue, goto or throw will never be executed." cwe="561">
        <error id="unreachableCode" severity="style" msg="Statements following return, break, continue, goto or throw will never be executed." verbose="Statements following return, break, continue, goto or throw will never be executed." cwe="561">
        <error id="variableScope" severity="style" msg="The scope of the variable &apos;pos&apos; can be reduced." verbose="The scope of the variable &apos;pos&apos; can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for &apos;i&apos; can be reduced:
void f(int x)
{
    int i = 0;
    if (x) {
        // it&apos;s safe to move &apos;int i = 0;&apos; here
        for (int n = 0; n &lt; 10; ++n) {
            // it is possible but not safe to move &apos;int i = 0;&apos; here
            do_something(&amp;i);
        }
    }
}
When you see this message it is always safe to reduce the variable scope 1 level." cwe="398">
        <error id="ConfigurationNotChecked" severity="information" msg="Skipping configuration &apos;MIC_ANGLE_DEVIATION&apos; since the value of &apos;MIC_ANGLE_DEVIATION&apos; is unknown. Use -D if you want to check it. You can use -U to skip it explicitly." verbose="Skipping configuration &apos;MIC_ANGLE_DEVIATION&apos; since the value of &apos;MIC_ANGLE_DEVIATION&apos; is unknown. Use -D if you want to check it. You can use -U to skip it explicitly."> 

/cc @LanFly @legendecas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant