Move out-of-bound case labels warning to the C front end

Joseph S. Myers jsm@polyomino.org.uk
Tue Jul 20 07:15:00 GMT 2004


On Mon, 19 Jul 2004, Steven Bosscher wrote:

> > What happens for case labels that are outside the range of the original
> > type but inside the range after conversion to the promoted type (which may
> > or may not be the same as the original)?  Warnings may make sense, but the
> > labels in such cases still need to be kept.
> 
> Those cases are also thrown out.  For example,

I mean such cases as

unsigned int i;

switch (i) { case 123456123456ULL: ... }

where the label is outside the range of unsigned int, but after conversion
to the promoted type (which is just unsigned int again) it is within
range.  Not cases where the conversion of case labels to the promoted type
has no effect, or where it changes them but they are still out of range of
the original type after than conversion.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)



More information about the Gcc-patches mailing list