[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#590152: gcc-4.5: ‘c_maybe_const_expr’ not supported by pp_c_expression



Package: gcc-4.5
Version: 4.5.0-8
Severity: minor
Justification: confusing error message

| $ cat testcase.c
| void foo(const char *p, int cond, int a, int b)
| {
| 	p[cond ? a : b] = '\0';
| }
| $ gcc-4.5 -c testcase.c
| #‘c_maybe_const_expr’ not supported by pp_c_expression#) != 0 ? (unsigned int)a : (unsigned int)b) * 1u))’testcase.c: In function ‘foo’:
| testcase.c:3:2: error: assignment of read-only location 
| $ gcc-4.4 -c testcase.c
| testcase.c: In function ‘foo’:
| testcase.c:3: error: assignment of read-only location ‘*(p + (cond != 0 ? (unsigned int)a : (unsigned int)b))’

The message is hard to decipher and missing a trailing newline.
As far as bugs go, it is only cosmetic, but presumably it supposed
to diagnose something deeper.

Is this about range checking?



Reply to: