c/3246: gcc -Wconversion doesn't work properly

ohhara@postech.edu ohhara@postech.edu
Mon Jun 18 23:56:00 GMT 2001


>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:



More information about the Gcc-bugs mailing list