On 11 Jun 2006 10:31:07 -0500, Gabriel Dos Reis <[EMAIL PROTECTED]> wrote:
"Manuel López-Ibáñez" <[EMAIL PROTECTED]> writes:
| My project is about "risky" coercions in general: assignments,
| operators, prototypes. You can see some (and comment and propose)
| testcases in http://gcc.gnu.org/wiki/Wcoercion .
void h2(void)
{
int i;
for(i=0; i < sizeof(double); i++);
}
when the ranges are known to imply no harm, it is irritating to get
the warning. It is conventional to use int a loop index.
Wsign-compare already emits a warning in this case. As far as I know,
there is no way in the front-end to know the ranges. The example,
perhaps should show be more evident:
for(i=-10; i < sizeof(double); i++);
This loop executes a total of 0 times. Yet, the previous testcase has
the benefit to show that currently we cannot know the ranges and we
should emit the warning.
Cheers,
Manuel.