[Python-Dev] Update PEP 7 to require curly braces in C (original) (raw)

Georg Brandl g.brandl at gmx.net
Mon Jan 18 02:02:20 EST 2016


On 01/17/2016 11:19 PM, Brett Cannon wrote:

On Sun, 17 Jan 2016, 13:59 Ethan Furman <ethan at stoneleaf.us_ _<mailto:ethan at stoneleaf.us>> wrote: On 01/17/2016 11:10 AM, Brett Cannon wrote: > https://www.imperialviolet.org/2014/02/22/applebug.html. Skipping the > curly braces is purely an aesthetic thing while leaving them out can > lead to actual bugs. Not sure what that sentence actually says, but +1 on making them mandatory.

Yeah, bad phrasing on my part. What I meant to say is leaving them off is an aesthetic thing while requiring them is a bug prevention thing. When it comes to writing C code I always vote for practicality over aesthetics.

+1.

Out of curiosity, I made a quick script to see if we had any candidates for bugs related to this. I didn't expect any bugs to be found, since with the amount of static checkers that have been run they should have been found. The only problem I found was in the S390 port of libffi (#ifdef-conditional code which wouldn't even compile).

I also found (in ast.c) two instances of semantically correct code with the wrong indent level which I fixed (see rev 1ececa34b748).

cheers, Georg



More information about the Python-Dev mailing list