public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/3246: gcc -Wconversion doesn't work properly
@ 2002-11-24 16:06 bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2002-11-24 16:06 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, ohhara

Synopsis: gcc -Wconversion doesn't work properly

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Mon Nov 18 15:38:31 2002
State-Changed-Why:
    Joseph already explained a long time ago why this is no
    bug and does what the documentation states.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3246


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c/3246: gcc -Wconversion doesn't work properly
@ 2001-06-19  5:16 Joseph S. Myers
  0 siblings, 0 replies; 3+ messages in thread
From: Joseph S. Myers @ 2001-06-19  5:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/3246; it has been noted by GNATS.

From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: <ohhara@postech.edu>
Cc: <gcc-gnats@gcc.gnu.org>,  <gcc-bugs@gcc.gnu.org>
Subject: Re: c/3246: gcc -Wconversion doesn't work properly
Date: Tue, 19 Jun 2001 13:13:33 +0100 (BST)

 On 19 Jun 2001 ohhara@postech.edu wrote:
 
 >  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.
 
 -Wconversion isn't meant for finding mistakes in new code - only for an 
 initial shake-down after converting ancient (predating the adoption of the 
 first C standard in 1989) code to modern C with prototypes.  The 
 documentation could be clearer, and there could (and should) be a more 
 useful version designed to warn about cases relevant to modern code (such 
 as sign differences causing security holes) only, but that isn't what 
 -Wconversion was designed to do.
 
 > Why does it prints warning message? Even if I changed "unsigned char"
 > to "unsigned short", the same warning message would be printed.
 
 Because with an old-style function definition and no prototype - the sort
 of program -Wconversion supposes you have just converted from - the
 argument would have been passed as an int.  This may not be a useful
 warning, but the present -Wconversion isn't particularly.  See the GCC
 projects list.
 
 -- 
 Joseph S. Myers
 jsm28@cam.ac.uk
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* c/3246: gcc -Wconversion doesn't work properly
@ 2001-06-18 23:56 ohhara
  0 siblings, 0 replies; 3+ messages in thread
From: ohhara @ 2001-06-18 23:56 UTC (permalink / raw)
  To: gcc-gnats

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-11-18 23:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-24 16:06 c/3246: gcc -Wconversion doesn't work properly bangerth
  -- strict thread matches above, loose matches on Subject: below --
2001-06-19  5:16 Joseph S. Myers
2001-06-18 23:56 ohhara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).