This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] BIT_FIELD_REF_UNSIGNED considered harmful
- From: Manfred Hollstein <mh at novell dot com>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: Richard Guenther <rguenther at suse dot de>, gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 5 Mar 2008 15:19:40 +0100
- Subject: Re: [PATCH] BIT_FIELD_REF_UNSIGNED considered harmful
- References: <Pine.LNX.4.64.0803051312050.4133@zhemvz.fhfr.qr> <47CE9668.8030707@google.com>
On Wed, 05 Mar 2008, 13:47:36 +0100, Diego Novillo wrote:
> On 03/05/08 07:18, Richard Guenther wrote:
>
> >Comments?
>
> Makes sense to me.
>
> >+ if (INTEGRAL_TYPE_P (TREE_TYPE (t))
> >+ && (TYPE_PRECISION (TREE_TYPE (t))
> >+ != TREE_INT_CST_LOW (TREE_OPERAND (t, 1))))
> >+ {
> >+ error ("integral result type precision does not match "
> >+ "field size of BIT_FIELD_REF");
> >+ return t;
> >+ }
> >+ if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
>
> 'else if' here?
In theory, yes, but, why? If the first 'if' part evaluates to true,
control flow jumps out of the function, hence the following 'if' is
totally correct (unless someone #define's return to something else...),
or do the GCC/FSF codings conventions require this to be 'else if'?
> Diego.
Cheers.
l8er
manfred