public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19564] New: -Wparentheses and other warnings: g++ is less sensitive than gcc
@ 2005-01-21 13:40 fm3 at os dot inf dot tu-dresden dot de
  2005-01-21 14:11 ` [Bug c++/19564] -Wparentheses does not work with the C++ front-end pinskia at gcc dot gnu dot org
  2005-01-21 14:12 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: fm3 at os dot inf dot tu-dresden dot de @ 2005-01-21 13:40 UTC (permalink / raw)
  To: gcc-bugs

g++ generates less warnings when using -Wparentheses than gcc. For instance  
gcc warns about  
  
  if (a>0 & b>0)  
    ...  
  
(warning: suggest parentheses around comparison in operand of &) but g++ does  
not. And gcc warns about  
  
  char a = 1024;  
  
(warning: overflow in implicit constant conversion) but g++ does not.

-- 
           Summary: -Wparentheses and other warnings: g++ is less sensitive
                    than gcc
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fm3 at os dot inf dot tu-dresden dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i486-linux


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


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

* [Bug c++/19564] -Wparentheses does not work with the C++ front-end
  2005-01-21 13:40 [Bug c++/19564] New: -Wparentheses and other warnings: g++ is less sensitive than gcc fm3 at os dot inf dot tu-dresden dot de
@ 2005-01-21 14:11 ` pinskia at gcc dot gnu dot org
  2005-01-21 14:12 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-21 14:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-21 14:11 -------
(In reply to comment #0)
> g++ generates less warnings when using -Wparentheses than gcc. For instance  
> gcc warns about  
>   
>   if (a>0 & b>0)  
>     ...  

This because this warning is only in the C front-end.

Please file the "overflow in implicit constant conversion" warning into a different bug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2005-01-21 14:11:16
               date|                            |
            Summary|-Wparentheses and other     |-Wparentheses does not work
                   |warnings: g++ is less       |with the C++ front-end
                   |sensitive than gcc          |


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


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

* [Bug c++/19564] -Wparentheses does not work with the C++ front-end
  2005-01-21 13:40 [Bug c++/19564] New: -Wparentheses and other warnings: g++ is less sensitive than gcc fm3 at os dot inf dot tu-dresden dot de
  2005-01-21 14:11 ` [Bug c++/19564] -Wparentheses does not work with the C++ front-end pinskia at gcc dot gnu dot org
@ 2005-01-21 14:12 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-21 14:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-21 14:12 -------
Note here is the testcase:
int f(int a, int b)
{
    if (a>0 & b>0) /* { dg-warning "" } */
     return 210;
  return 0;

}

-- 


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


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

end of thread, other threads:[~2005-01-21 14:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-21 13:40 [Bug c++/19564] New: -Wparentheses and other warnings: g++ is less sensitive than gcc fm3 at os dot inf dot tu-dresden dot de
2005-01-21 14:11 ` [Bug c++/19564] -Wparentheses does not work with the C++ front-end pinskia at gcc dot gnu dot org
2005-01-21 14:12 ` pinskia 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).