This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Inconsistency in -Wconversion
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Inconsistency in -Wconversion
- From: Claus Fischer <claus dot fischer at intel dot com>
- Date: Tue, 14 Mar 2000 14:03:43 -0800 (PST)
- Reply-To: Claus Fischer <claus dot fischer at intel dot com>
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