Re: Compiler warning cleanup - unitilized const variables, pointer type mismatch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Compiler warning cleanup - unitilized const variables, pointer type mismatch
Date
Msg-id 10902.1243526259@sss.pgh.pa.us
Whole thread Raw
In response to Re: Compiler warning cleanup - unitilized const variables, pointer type mismatch  (Michael Meskes <meskes@postgresql.org>)
Responses Re: Compiler warning cleanup - unitilized const variables, pointer type mismatch  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
List pgsql-hackers
Michael Meskes <meskes@postgresql.org> writes:
> I have to admit that those version look strikingly unsimilar to me. There is no
> reference to Rhs[N] in our macro at all. But then I have no idea whether this
> is needed.

The default version of the macro is intended to track both the starting
and ending locations of every construct.  Our simplified version only
tracks the starting locations.  The inputs are RHS[k], the location
values for the constituent elements of the current production, and
the output is the location value for the construct being formed.
In the default version, you naturally want to copy the start of
RHS[1] and the end of RHS[N], where N is the number of production
elements.  In ours, we just copy the location of RHS[1].  However,
both macros need a special case for empty productions (with N = 0).

AFAICS, Sun's compiler is just too stupid and shouldn't be emitting
this warning.  Perhaps the right response is to file a bug report
against the compiler.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: User-facing aspects of serializable transactions
Next
From: "Kevin Grittner"
Date:
Subject: Re: User-facing aspects of serializable transactions