This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Inconsistency in -Wconversion



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.

Claus

************************************************

cat <<EOF >x.c
    typedef enum { a } __attribute__((packed)) t;
    void f(t x) {}
    int main(void)
    {
    	t x[2], y;
    	f(x[0]);
    	f(y);
    	return 0;
    }
EOF
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

-- 
claus.fischer@intel.com   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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]