Strange warning about passing argument with different width due to prototype with gcc 4.4.0 on 64 bits machine

José Luis García Pallero jgpallero@gmail.com
Tue Aug 24 13:28:00 GMT 2010


Hello,
I'm trying to compile a simple program with gcc 4.4.0 in an intel Xeon
machine running RHEL (I haven't any other posibility). I'm using the
warning flag -Wconversion in order to check type conversions without
explicit cast. When I work with data types as int and long in
functions and pass the data without explicit casts the warning flag
runs OK and when I do the explicit cast the warning dissapears. But
when I do the same with a function that admits a single char argument,
allways (with explicit cast too) the warning appears as

warning: passing argument 1 of ‘printChar’ with different width due to prototype

Attached I sent 4 files (three src and a Makefile) in order to
reproduce the behaviour.

But if I run the Makefile in my laptop (iBook ppc running Debian
GNU/Linux) with gcc 4.4.4 all runs OK. The warning not appears in the
case of char argument. I don't know if it is a bug of gcc 4.4.0 or a
feature related to 64 bits or a bug in RHEL gcc.

Can someone reproduce the behaviour?

Thanks

-- 
*****************************************
José Luis García Pallero
jgpallero@gmail.com
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libtest.h
Type: text/x-c
Size: 198 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20100824/c5ddfe07/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libtest.c
Type: text/x-csrc
Size: 195 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20100824/c5ddfe07/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 192 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20100824/c5ddfe07/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 184 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20100824/c5ddfe07/attachment.obj>


More information about the Gcc-help mailing list