Re: Further news on Clang - spurious warnings

From: Greg Stark <stark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Geoghegan <peter(at)2ndquadrant(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Further news on Clang - spurious warnings
Date: 2011-08-13 21:49:25
Message-ID: CAM-w4HOA-_vkj4LaChHTttwE5VXmTxx-3_wVrjYeJwrK3OpS9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I realize it's a bit late to jump in here with the path already having been
committed. But I think there's a point that was missed in the discussion.
One reason to do the test as Tom recommended is that the warning probably
indicates that the test as written was just going to be optimized away as
dead code. I think the cast to unsigned is the least likely idiom to be
optimized away whereas any of the formulations based on comparing the enum
with enum labels is quite likely to be.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-08-13 22:13:16 VACUUM FULL versus TOAST
Previous Message Heikki Linnakangas 2011-08-13 21:31:21 Re: index-only scans