| От | Tom Lane |
|---|---|
| Тема | Re: do {} while (0) nitpick |
| Дата | |
| Msg-id | 3065.1588297870@sss.pgh.pa.us обсуждение |
| Ответ на | do {} while (0) nitpick (John Naylor <john.naylor@2ndquadrant.com>) |
| Ответы |
Re: do {} while (0) nitpick
|
| Список | pgsql-hackers |
John Naylor <john.naylor@2ndquadrant.com> writes:
> As I understand it, the point of having "do {} while (0)" in a
> multi-statement macro is to turn it into a simple statement.
Right.
> As such,
> ending with a semicolon in both the macro definition and the
> invocation will turn it back into multiple statements, creating
> confusion if someone were to invoke the macro in an "if" statement.
Yeah. I'd call these actual bugs, and perhaps even back-patch worthy.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера