From mboxrd@z Thu Jan 1 00:00:00 1970 From: ohhara@postech.edu To: gcc-gnats@gcc.gnu.org Subject: c/3246: gcc -Wconversion doesn't work properly Date: Mon, 18 Jun 2001 23:56:00 -0000 Message-id: <20010619064929.18134.qmail@sourceware.cygnus.com> X-SW-Source: 2001-06/msg00763.html List-Id: >Number: 3246 >Category: c >Synopsis: gcc -Wconversion doesn't work properly >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Jun 18 23:56:02 PDT 2001 >Closed-Date: >Last-Modified: >Originator: ohhara@postech.edu >Release: gcc version 2.95.2 19991024 (release) >Organization: >Environment: redhat linux 6.2 i386, kernel 2.2.16-3, gcc 2.95.2, glibc-2.1.3-22 >Description: I use many warning options to find my small ( or big ) mistakes. Therefore, I tried to use -Wconversion warning option. However, it doesn't seem to work properly. For example, I tried following code with -Wconversion option. ---------- void f(unsigned char a); void f(unsigned char a) { } int main() { unsigned char a = 1; f(a); return 0; } ---------- And tried to compile this code ---------- [ ohhara@vm ~/tmp ] {180} $ gcc -Wconversion wconv.c wconv.c: In function `main': wconv.c:9: warning: passing arg 1 of `f' with different width due to prototype ---------- Why does it prints warning message? Even if I changed "unsigned char" to "unsigned short", the same warning message would be printed. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: