Re: Clang compiler warning on 9.3 HEAD

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Will Leinweber <will(at)heroku(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Clang compiler warning on 9.3 HEAD
Date: 2013-04-04 20:37:55
Message-ID: 20130404203755.GM5117@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
obj-type-class.patch text/x-diff 2.3 KB

In response to

Responses

Browse pgsql-hackers by date

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