Article 15JMS Malcolm: GCC 6: -Wmisleading-indentation vs “goto fail;”

Malcolm: GCC 6: -Wmisleading-indentation vs “goto fail;”

by
ris
from LWN.net on (#15JMS)
David Malcolm takesa look at a new compiler warning in GCC 6,-Wmisleading-indentation. "At a high level, the underlying implementation looks at control statements (if/else, while, for), and if it sees them guard a single statement without braces, it looks at the followup statement. It complains if both have the same indentation.That's a simplified description - we spent a fair amount of time working on heuristics in the warning, to try to ensure that it warns for all cases that are reasonable to warn for, whilst not complaining unduly for indentation that's merely bad (rather than being actively misleading). We've also tested it with a variety of coding styles: GNU, K&R, Linux kernel, etc."
External Content
Source RSS or Atom Feed
Feed Location http://lwn.net/headlines/rss
Feed Title LWN.net
Feed Link https://lwn.net/
Reply 0 comments