Inconsistency in -Wconversion

Claus Fischer
Tue Mar 14 14:03:00 GMT 2000

Just FYI:

One would expect the compiler to give the same kind of warnings
for both function calls in the following program, but it warns
only for the call where the argument is instantiated with the
array member. It probably shouldn't warn at all.



cat <<EOF >x.c
    typedef enum { a } __attribute__((packed)) t;
    void f(t x) {}
    int main(void)
    	t x[2], y;
    	return 0;
gcc -o x x.c -Wconversion


x.c: In function `main':
x.c:6: warning: passing arg 1 of `f' with different width due to prototype

--   Intel Corporation SC12-205 ... not speaking
phone   +1-408-765-6808   2200 Mission College Blvd.           for Intel
fax     +1-408-765-9322   Santa Clara, CA 95052-8119

More information about the Gcc-bugs mailing list