On Fri, 19 Sep 2008, Manuel López-Ibáñez wrote:
> This should be fixed in any recent GCC 4.4. snapshot. But I cannot
> test it myself to be sure, if someone would be so kind to check this
> for me, I would appreciate it.
Confirmed on i386-unknown-freebsd6.3 using soures as of 20 hours ago.
Gerald
2008/9/19 Andriy Gapon <[EMAIL PROTECTED]>:
>
> If I replace 'x' with a constant (0 or 1) in the condition, then the code
> compiles.
> I think gcc should be smarter here.
This should be fixed in any recent GCC 4.4. snapshot. But I cannot
test it myself to be sure, if someone would be so kind to c
void f(int x)
{
char c = x ? '|' : '/';
}
$ cc1: warnings being treated as errors
char.c: In function 'f':
char.c:3: error: conversion to 'char' from 'int' may alter its value
Exit 1
If I replace 'x' with a constant (0 or 1) in the condition, then the
code compiles.
I think gcc shoul