Re: do {} while (0) nitpick
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Steele <david@pgmasters.net>
Cc: Bruce Momjian <bruce@momjian.us>,
John Naylor <john.naylor@2ndquadrant.com>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2020-05-01T21:32:11Z
Lists: pgsql-hackers
David Steele <david@pgmasters.net> writes: > On 4/30/20 9:52 PM, Bruce Momjian wrote: >> On Thu, Apr 30, 2020 at 09:51:10PM -0400, Tom Lane wrote: >>> Yeah. I'd call these actual bugs, and perhaps even back-patch worthy. >> Agreed. Those semicolons could easily create bugs. > +1. The patch looks good to me. Grepping showed me that there were some not-do-while macros that also had trailing semicolons. These seem just as broken, so I fixed 'em all. There are remaining instances of this antipattern in the flex-generated scanners, which we can't do anything about; and in pl/plperl/ppport.h, which we shouldn't do anything about because that's upstream-generated code. (I wonder though if there's a newer version available.) regards, tom lane
Commits
-
Get rid of trailing semicolons in C macro definitions.
- ad80d3ea27b1 9.5.22 landed
- a8df87d8638c 9.6.18 landed
- a2098b60216c 11.8 landed
- 49718aa9ee5e 10.13 landed
- c08da32f133b 12.3 landed
- 0da06d9faf9e 13.0 landed