public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/9072] -Wconversion should be split into two distinct flags
       [not found] <bug-9072-1672@http.gcc.gnu.org/bugzilla/>
@ 2006-07-05 11:16 ` lopezibanez at gmail dot com
  2006-07-05 11:19 ` lopezibanez at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: lopezibanez at gmail dot com @ 2006-07-05 11:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from lopezibanez at gmail dot com  2006-07-05 11:15 -------
Created an attachment (id=11826)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11826&action=view)
split current functionality of Wconversion in two different options

This patch divides the functionality of Wconversion into two additional warning
options Wtradtional-conversion and Wcoercion as part of the Wcoercion project 
(
http://gcc.gnu.org/wiki/Wcoercion#Background ). These are added for the sake of
clarity (in order to distinguish them from the current Wconversion) and during
the development phase and they are not meant to be the final form that the
options will take.

Bootstrapped and tested in i686-pc-linux-gnu for trunk revision 115112.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072


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

* [Bug c/9072] -Wconversion should be split into two distinct flags
       [not found] <bug-9072-1672@http.gcc.gnu.org/bugzilla/>
  2006-07-05 11:16 ` [Bug c/9072] -Wconversion should be split into two distinct flags lopezibanez at gmail dot com
@ 2006-07-05 11:19 ` lopezibanez at gmail dot com
  2006-07-05 11:22 ` lopezibanez at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: lopezibanez at gmail dot com @ 2006-07-05 11:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from lopezibanez at gmail dot com  2006-07-05 11:18 -------
Created an attachment (id=11827)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11827&action=view)
Adds a new function which detects when a real value can be exactly represented
as an integer.

Patch 2of3 http://gcc.gnu.org/wiki/Wcoercion#Background

Adds a new function which detects when a real value can be exactly represented
as an integer. This function is needed for the next patch.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072


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

* [Bug c/9072] -Wconversion should be split into two distinct flags
       [not found] <bug-9072-1672@http.gcc.gnu.org/bugzilla/>
  2006-07-05 11:16 ` [Bug c/9072] -Wconversion should be split into two distinct flags lopezibanez at gmail dot com
  2006-07-05 11:19 ` lopezibanez at gmail dot com
@ 2006-07-05 11:22 ` lopezibanez at gmail dot com
  2006-11-23 18:40 ` manu at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: lopezibanez at gmail dot com @ 2006-07-05 11:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from lopezibanez at gmail dot com  2006-07-05 11:22 -------
Created an attachment (id=11828)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11828&action=view)
detect implicit conversions where a value may change

patch 3of3 http://gcc.gnu.org/wiki/Wcoercion#Background

Detect implicit conversions where a value may change by narrowing, loss of
precision or change of sign when passing arguments and in assignments. It
includes testcases.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072


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

* [Bug c/9072] -Wconversion should be split into two distinct flags
       [not found] <bug-9072-1672@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2006-07-05 11:22 ` lopezibanez at gmail dot com
@ 2006-11-23 18:40 ` manu at gcc dot gnu dot org
  2006-11-23 18:55 ` lopezibanez at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2006-11-23 18:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from manu at gcc dot gnu dot org  2006-11-23 18:39 -------
Subject: Bug 9072

Author: manu
Date: Thu Nov 23 18:39:32 2006
New Revision: 119129

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119129
Log:
2006-11-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

        PR c/9072 
        * c.opt (Wtraditional-conversion): New.
        (Wconversion): Update description.
        * c-typeck.c (convert_arguments): Warnings for prototypes causing
        type conversions different from what would happen in the absence
        of prototype are now handled by Wtraditional-conversion.
        * doc/invoke.texi (Wtraditional-conversion): New.
        (Wconversion): Update description.
        * doc/trouble.texi (Wconversion): Replace Wconversion by
        Wtraditional-conversion.

testsuite/

        PR c/9072 
        * gcc.dg/builtin-protos-1.c: Replace Wconversion by
        Wtraditional-conversion.
        * gcc.dg/overflow-warn-2.c: Likewise.
        * gcc.dg/Wconversion.c: Likewise. Renamed as
        Wtraditional-conversion.c .
        * gcc.dg/Wconversion-2.c: Likewise. Renamed as
        Wtraditional-conversion-2.c .
        * gcc.dg/dfp/Wconversion-2.c: Likewise. Renamed as
        Wtraditional-conversion-2.c 
        * gcc.dg/Wconversion-negative-constants.c: New.


Added:
    trunk/gcc/testsuite/gcc.dg/Wconversion-negative-constants.c
    trunk/gcc/testsuite/gcc.dg/Wtraditional-conversion-2.c
      - copied, changed from r119128,
trunk/gcc/testsuite/gcc.dg/Wconversion-2.c
    trunk/gcc/testsuite/gcc.dg/Wtraditional-conversion.c
      - copied, changed from r119128, trunk/gcc/testsuite/gcc.dg/Wconversion.c
    trunk/gcc/testsuite/gcc.dg/dfp/Wtraditional-conversion-2.c
      - copied, changed from r119128,
trunk/gcc/testsuite/gcc.dg/dfp/Wconversion-2.c
Removed:
    trunk/gcc/testsuite/gcc.dg/Wconversion-2.c
    trunk/gcc/testsuite/gcc.dg/Wconversion.c
    trunk/gcc/testsuite/gcc.dg/dfp/Wconversion-2.c
Modified:
    trunk/ChangeLog
    trunk/gcc/ChangeLog
    trunk/gcc/c-typeck.c
    trunk/gcc/c.opt
    trunk/gcc/doc/invoke.texi
    trunk/gcc/doc/trouble.texi
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/builtin-protos-1.c
    trunk/gcc/testsuite/gcc.dg/overflow-warn-2.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072


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

* [Bug c/9072] -Wconversion should be split into two distinct flags
       [not found] <bug-9072-1672@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2006-11-23 18:40 ` manu at gcc dot gnu dot org
@ 2006-11-23 18:55 ` lopezibanez at gmail dot com
  2006-11-23 22:51 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: lopezibanez at gmail dot com @ 2006-11-23 18:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from lopezibanez at gmail dot com  2006-11-23 18:55 -------
I have insufficient privileges to close this bug. Please, someone, close it as
FIXED. Thanks.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072


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

* [Bug c/9072] -Wconversion should be split into two distinct flags
       [not found] <bug-9072-1672@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2006-11-23 18:55 ` lopezibanez at gmail dot com
@ 2006-11-23 22:51 ` pinskia at gcc dot gnu dot org
  2007-02-23 16:09 ` manu at gcc dot gnu dot org
  2008-02-15 20:51 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-11-23 22:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from pinskia at gcc dot gnu dot org  2006-11-23 22:51 -------
(In reply to comment #18)
> I have insufficient privileges to close this bug. Please, someone, close it as
> FIXED. Thanks.

You should be able to use your @gcc.gnu.org account to close the bug report.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072


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

* [Bug c/9072] -Wconversion should be split into two distinct flags
       [not found] <bug-9072-1672@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2006-11-23 22:51 ` pinskia at gcc dot gnu dot org
@ 2007-02-23 16:09 ` manu at gcc dot gnu dot org
  2008-02-15 20:51 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-02-23 16:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from manu at gcc dot gnu dot org  2007-02-23 16:09 -------
*** Bug 30916 has been marked as a duplicate of this bug. ***


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hermantenbrugge at home dot
                   |                            |nl


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072


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

* [Bug c/9072] -Wconversion should be split into two distinct flags
       [not found] <bug-9072-1672@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2007-02-23 16:09 ` manu at gcc dot gnu dot org
@ 2008-02-15 20:51 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-02-15 20:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from pinskia at gcc dot gnu dot org  2008-02-15 20:50 -------
*** Bug 35214 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason dot vas dot dias at
                   |                            |gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072


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

* [Bug c/9072] -Wconversion should be split into two distinct flags
       [not found] <20021227153602.9072.128950@bugs.debian.org>
  2003-10-03 15:24 ` Jay dot St dot Pierre at Colorado dot EDU
  2005-03-15 23:22 ` gcc at sopwith dot solgatos dot com
@ 2005-03-19 13:35 ` jsm28 at gcc dot gnu dot org
  2 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2005-03-19 13:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jsm28 at gcc dot gnu dot org  2005-03-19 13:34 -------
*** Bug 20535 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |olh at suse dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072


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

* [Bug c/9072] -Wconversion should be split into two distinct flags
       [not found] <20021227153602.9072.128950@bugs.debian.org>
  2003-10-03 15:24 ` Jay dot St dot Pierre at Colorado dot EDU
@ 2005-03-15 23:22 ` gcc at sopwith dot solgatos dot com
  2005-03-19 13:35 ` jsm28 at gcc dot gnu dot org
  2 siblings, 0 replies; 11+ messages in thread
From: gcc at sopwith dot solgatos dot com @ 2005-03-15 23:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gcc at sopwith dot solgatos dot com  2005-03-15 23:22 -------
I observe that gcc -Wconversion generates the exact same warning
message for converting from narrow to wide as it does for converting
from wide to narrow.  Correct me if I'm wrong, but converting from
narrow to wide should always be safe, while converting from wide to
narrow is not safe.  I would like to be able to find the unsafe
conversions without drowning in warning messages about safe conversions.
This would make porting code from ILP32 to LP64 easier.

sopwith cat conversion2.c
#include <stdio.h>

void func1(int);
void func2(long);

int
main(void)
{
  long a;

  func1(5);
  func2(5);  /* line 12 - conversion appears to be harmless? */

  a = 5;
  func1(a); /* line 15 - conversion appears to be harmless? (since the data fits
in 32 bits) */
  func2(a);

  a = 50000000000;
  func1(a); /* line 19 - conversion throws away data */
  func2(a);

  return 0;
}

void
func1(int arg)
{
  printf("func1: arg = %d\n", arg);
}

void
func2(long arg)
{
  printf("func2: arg = %ld\n", arg);
}
sopwith gcc -O2 -Wconversion conversion2.c -o conversion2
conversion2.c: In function `main':
conversion2.c:12: warning: passing arg 1 of `func2' with different width due to
prototype
conversion2.c:15: warning: passing arg 1 of `func1' with different width due to
prototype
conversion2.c:19: warning: passing arg 1 of `func1' with different width due to
prototype
sopwith ./conversion2
func1: arg = 5
func2: arg = 5
func1: arg = 5
func2: arg = 5
func1: arg = -1539607552
func2: arg = 50000000000
sopwith 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072


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

* [Bug c/9072] -Wconversion should be split into two distinct flags
       [not found] <20021227153602.9072.128950@bugs.debian.org>
@ 2003-10-03 15:24 ` Jay dot St dot Pierre at Colorado dot EDU
  2005-03-15 23:22 ` gcc at sopwith dot solgatos dot com
  2005-03-19 13:35 ` jsm28 at gcc dot gnu dot org
  2 siblings, 0 replies; 11+ messages in thread
From: Jay dot St dot Pierre at Colorado dot EDU @ 2003-10-03 15:24 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072


Jay dot St dot Pierre at Colorado dot EDU changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Jay dot St dot Pierre at
                   |                            |Colorado dot EDU


------- Additional Comments From Jay dot St dot Pierre at Colorado dot EDU  2003-10-03 15:24 -------
Note that this is still an issue with 3.3.1.


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

end of thread, other threads:[~2008-02-15 20:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-9072-1672@http.gcc.gnu.org/bugzilla/>
2006-07-05 11:16 ` [Bug c/9072] -Wconversion should be split into two distinct flags lopezibanez at gmail dot com
2006-07-05 11:19 ` lopezibanez at gmail dot com
2006-07-05 11:22 ` lopezibanez at gmail dot com
2006-11-23 18:40 ` manu at gcc dot gnu dot org
2006-11-23 18:55 ` lopezibanez at gmail dot com
2006-11-23 22:51 ` pinskia at gcc dot gnu dot org
2007-02-23 16:09 ` manu at gcc dot gnu dot org
2008-02-15 20:51 ` pinskia at gcc dot gnu dot org
     [not found] <20021227153602.9072.128950@bugs.debian.org>
2003-10-03 15:24 ` Jay dot St dot Pierre at Colorado dot EDU
2005-03-15 23:22 ` gcc at sopwith dot solgatos dot com
2005-03-19 13:35 ` jsm28 at gcc dot gnu dot org

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).