public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org
Subject: Re: c/3246: gcc -Wconversion doesn't work properly
Date: Tue, 19 Jun 2001 05:16:00 -0000	[thread overview]
Message-ID: <20010619121603.999.qmail@sourceware.cygnus.com> (raw)

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
 


             reply	other threads:[~2001-06-19  5:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-19  5:16 Joseph S. Myers [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-24 16:06 bangerth
2001-06-18 23:56 ohhara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010619121603.999.qmail@sourceware.cygnus.com \
    --to=jsm28@cam.ac.uk \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).