Skip to content

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

Open
@henrygab

Description

@henrygab

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions