public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: -Wparentheses is less sensitive in g++
@ 2005-01-19 17:39 lrtaylor
  2005-01-19 17:42 ` Frank Mehnert
  2005-01-20 18:08 ` Frank Mehnert
  0 siblings, 2 replies; 5+ messages in thread
From: lrtaylor @ 2005-01-19 17:39 UTC (permalink / raw)
  To: fm3, gcc-help

Dunno about the parentheses, but you should have two ampersands in there
instead of one...

  if (a>0 && b>0)


Thanks,
Lyle

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Frank Mehnert
Sent: Wednesday, January 19, 2005 10:37 AM
To: gcc-help@gcc.gnu.org
Subject: -Wparentheses is less sensitive in g++

Hi,

is there any reason for g++ to be less sensitive when using the
-Wparentheses option than gcc? For example gcc warns about the
following line

  if (a>0 & b>0)
    ...

but g++ does not. Why?

I've checked this with g++2.95, g++-3.2, g++-3.3 and g++-3.4.

Frank
-- 
## Dept. of Computer Science, Dresden University of Technology, Germany
##
## http://os.inf.tu-dresden.de/~fm3
##

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

* Re: -Wparentheses is less sensitive in g++
  2005-01-19 17:39 -Wparentheses is less sensitive in g++ lrtaylor
@ 2005-01-19 17:42 ` Frank Mehnert
  2005-01-20 18:08 ` Frank Mehnert
  1 sibling, 0 replies; 5+ messages in thread
From: Frank Mehnert @ 2005-01-19 17:42 UTC (permalink / raw)
  To: lrtaylor; +Cc: gcc-help

[-- Attachment #1: Type: text/plain, Size: 439 bytes --]

On Wednesday 19 January 2005 18:38, lrtaylor@micron.com wrote:
> Dunno about the parentheses, but you should have two ampersands in there
> instead of one...
>
>   if (a>0 && b>0)

Yes, that's why I think that g++ should warn about this statement ... :-)

Cheers,

Frank
-- 
## Dept. of Computer Science, Dresden University of Technology, Germany ##
## http://os.inf.tu-dresden.de/~fm3                                     ##

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: -Wparentheses is less sensitive in g++
  2005-01-19 17:39 -Wparentheses is less sensitive in g++ lrtaylor
  2005-01-19 17:42 ` Frank Mehnert
@ 2005-01-20 18:08 ` Frank Mehnert
  2005-01-20 18:32   ` Ian Lance Taylor
  1 sibling, 1 reply; 5+ messages in thread
From: Frank Mehnert @ 2005-01-20 18:08 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 755 bytes --]

On Wednesday 19 January 2005 18:38, you wrote:
> Dunno about the parentheses, but you should have two ampersands in there
> instead of one...
>
>   if (a>0 && b>0)

To be more precise: I really _want_ that g++ warns me about it when I use
(a>0 & b>0)! g++ seems to be much more sloppy than gcc with warnings. Another
issue is

  char a = 1024;

gcc warns about ``overflow in implicit constant conversion'', g++ does not.
Why?

Is there any way to improve the g++ warning level? I've tried anything
(-Wparentheses, -Wall, -W) but nothing helps. Should I file a bug report?

Frank
-- 
## Dept. of Computer Science, Dresden University of Technology, Germany ##
## http://os.inf.tu-dresden.de/~fm3                                     ##

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: -Wparentheses is less sensitive in g++
  2005-01-20 18:08 ` Frank Mehnert
@ 2005-01-20 18:32   ` Ian Lance Taylor
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Lance Taylor @ 2005-01-20 18:32 UTC (permalink / raw)
  To: Frank Mehnert; +Cc: gcc-help

Frank Mehnert <fm3@os.inf.tu-dresden.de> writes:

> Is there any way to improve the g++ warning level? I've tried anything
> (-Wparentheses, -Wall, -W) but nothing helps. Should I file a bug report?

Yes, please, at http://gcc.gnu.org/bugzilla/.  Thanks.

Ian

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

* -Wparentheses is less sensitive in g++
@ 2005-01-19 17:36 Frank Mehnert
  0 siblings, 0 replies; 5+ messages in thread
From: Frank Mehnert @ 2005-01-19 17:36 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

Hi,

is there any reason for g++ to be less sensitive when using the
-Wparentheses option than gcc? For example gcc warns about the
following line

  if (a>0 & b>0)
    ...

but g++ does not. Why?

I've checked this with g++2.95, g++-3.2, g++-3.3 and g++-3.4.

Frank
-- 
## Dept. of Computer Science, Dresden University of Technology, Germany ##
## http://os.inf.tu-dresden.de/~fm3                                     ##

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2005-01-20 18:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-19 17:39 -Wparentheses is less sensitive in g++ lrtaylor
2005-01-19 17:42 ` Frank Mehnert
2005-01-20 18:08 ` Frank Mehnert
2005-01-20 18:32   ` Ian Lance Taylor
  -- strict thread matches above, loose matches on Subject: below --
2005-01-19 17:36 Frank Mehnert

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