This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for various warnings in gcc
Zack Weinberg <zack@codesourcery.com> writes:
| On Thu, Aug 08, 2002 at 01:57:29PM -0400, Kaveh R. Ghazi wrote:
| > > Personally I agree with Dale that 'int a = a;' is too obscure a way of
| > > silencing this warning. If we must have a way to disable it without
| > > generating extra code, let us create __attribute__ ((initialized))
| > > which states explicitly what is going on.
| >
| > The attribute would be more readable but it would still suffer from
| > the non-determinism, right?
|
| Yes. This would not be for use in GCC itself. Paul has a good point
| that in some contexts the extra initialization is too costly, but the
| 'a=a' idiom is not documented, nor is it obvious to a reader that its
| sole effect is to silence this warning. So I think we should have a
| more readable way to get that effect.
I agree in principle. While your __attribute__(()) proposal is
certainly a far better alternative of what has been proposed, I think that
the compiler should be instructred about value/condition propogation
and not warn in cases the variable is "manifestly" initialized -- but
GCC is insisting on warning just because it didn't do a good job at
propagating conditions.
-- Gaby