Tom Lane wrote:
> Michael Meskes writes:
> > On Mon, May 25, 2009 at 10:19:40AM -0400, Tom Lane wrote:
> >> That sounds both dangerous and against our coding conventions. The
> >> standard way to do that is "do { ... } while (0)"
>
> > Which won't work here as the macros have continue and break
On Mon, May 25, 2009 at 12:10:49PM -0400, Tom Lane wrote:
> [ thinks for a bit... ] What might be both safe and warning-free
> is to code an explicit empty statement, viz macro body as
>
> if (1) { ... } else ((void) 0)
I just tried this and yes, it quietens gcc and probably is at least as
Michael Meskes writes:
> On Mon, May 25, 2009 at 12:10:49PM -0400, Tom Lane wrote:
>> Consider
>>
>> if (...)
>> macro;
>> else
>> something-else;
> Sure, but some/most/all macros are called as
> MACRO;
> No real reason there it seems.
Well, they are calle
On Mon, May 25, 2009 at 12:10:49PM -0400, Tom Lane wrote:
> Consider
>
> if (...)
> macro;
> else
> something-else;
> ...
Sure, but some/most/all macros are called as
MACRO;
No real reason there it seems.
> [ thinks for a bit... ] What might be both sa
Michael Meskes writes:
> On Mon, May 25, 2009 at 11:27:27AM -0400, Tom Lane wrote:
>> You can't just remove the "else", or it's unsafe;
> But why? What does this empty else accomplish?
Consider
if (...)
macro;
else
something-else;
Without the "el
On Mon, May 25, 2009 at 11:27:27AM -0400, Tom Lane wrote:
> Oh, right, that was Bruce's "improvement" of the COPY code. I was less
> than thrilled with it, but didn't have an easy alternative.
>
> You can't just remove the "else", or it's unsafe; and I'm afraid that
But why? What does this empty
Michael Meskes writes:
> On Mon, May 25, 2009 at 10:19:40AM -0400, Tom Lane wrote:
>> That sounds both dangerous and against our coding conventions. The
>> standard way to do that is "do { ... } while (0)"
> Which won't work here as the macros have continue and break commands in them.
Oh, right
On Mon, May 25, 2009 at 10:19:40AM -0400, Tom Lane wrote:
> Michael Meskes 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
>
Michael Meskes 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 #de
Hi,
sitting here on my flight back I went through the list of all warnings gcc
spits out when using -Wextra. There are a whole lot of them (~ 1700) that
mostly (except one) fall into one of four classes:
- unused parameters: ~ 600
- some combination of signed and unsigned: ~ 600
Are we really s
10 matches
Mail list logo