Re: Warnings in compile
| От | Tom Lane |
|---|---|
| Тема | Re: Warnings in compile |
| Дата | |
| Msg-id | 2830.1243261180@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Warnings in compile (Michael Meskes <meskes@postgresql.org>) |
| Ответы |
Re: Warnings in compile
|
| Список | pgsql-hackers |
Michael Meskes <meskes@postgresql.org> writes:
> - some combination of signed and unsigned: ~ 600
> Are we really sure that *all* compilers out there do handle this correctly?
The behavior is spelled out in the C spec, and always has been. You
might as well worry if they handle "if" correctly.
> There are some #defines of the form
> #define foo if(1) { ... } else
> that are called as foo;
> I see the need for the macro to expand as block, but what use hase the empty
> else?
That sounds both dangerous and against our coding conventions. The
standard way to do that is "do { ... } while (0)"
regards, tom lane
В списке pgsql-hackers по дате отправления: