Re: Clang compiler warning on 9.3 HEAD - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Clang compiler warning on 9.3 HEAD
Date
Msg-id 20130404203755.GM5117@eldon.alvh.no-ip.org
Whole thread Raw
In response to Clang compiler warning on 9.3 HEAD  (Will Leinweber <will@heroku.com>)
Responses Re: Clang compiler warning on 9.3 HEAD
Re: Clang compiler warning on 9.3 HEAD
List pgsql-hackers
Will Leinweber wrote:
> On ref 8507907 when compiling with clang on os x, I got this warning which
> seems like a possible bug.
>
> I thought to report this because I imagine clang isn't frequently used
> day-to-day by most.

Ugh.  My fault.  Yes, this is a bug.

I don't see any nice way to convert ObjectType to ObjectClass or the
other way around; it seems to me the only simple way to fix this is to
add a new function EventTriggerSupportsObjectClass(), which takes
ObjectClass instead of ObjectType.  Patch attached.

Now, it annoys me that we now have three places that know about object
types supported by event triggers: there's a large struct of command tag
substrings (event_trigger_support), then there's these two functions.
It might be better to add ObjectType and ObjectClass entries to the
struct, so that only the struct needs to know about that.  The problem
is that these two functions would have to walk the struct every time,
instead of being a simple switch.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Next
From: Andres Freund
Date:
Subject: Re: corrupt pages detected by enabling checksums