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

GCC Warning ... Misleading formatting ... BUG? #103

Open
henrygab opened this issue Mar 26, 2021 · 0 comments
Open

GCC Warning ... Misleading formatting ... BUG? #103

henrygab opened this issue Mar 26, 2021 · 0 comments

Comments

@henrygab
Copy link

GCC now will warn about this, preventing compilation with all warnings enabled.

if(interval>0)LowSpace=min(LowSpace, interval); HiSpace=max (HiSpace, interval);

@cyborg5 -- Is this code intended to be:

if(interval>0) {
    LowSpace=min(LowSpace, interval);
    HiSpace=max (HiSpace, interval); 
}

It is clearly formatted to suggest the entire line is gated by the if statement. However, the current code (if formatted more commonly) resolves as:

if(interval>0) {
    LowSpace=min(LowSpace, interval);
}
HiSpace=max (HiSpace, interval); 

Thanks for helping know which code is the correct fix!

See also adafruit/Adafruit_CircuitPlayground#63

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

No branches or pull requests

1 participant