https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115178
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to lfoldy from comment #2)
> OK, thanks.
>
> I have millions of this warning in a huge generated file. How can I silence
> this check? -Wno-jump-misses-init works for C only.
You can make then local labels like:
int test(int i)
{
int res=0;
{
__label__ l1;
__label__ l2;
const void* labels1[2]={&&l1, &&l2};
goto *labels1[i&1];
l1: res=1;
l2: res=2;
}
{
__label__ l3;
__label__ l4;
const void* labels2[2]={&&l3, &&l4};
goto *labels2[i&1];
l3: res=3;
l4: res=4;
}
return res;
}
So the warning knows that the labels in inner scopes cannot be jumpped to
outside of that scope.