This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: suggest parentheses around assignment used as truth value
- To: Carlo Wood <carlo at runaway dot xs4all dot nl>
- Subject: Re: suggest parentheses around assignment used as truth value
- From: Kamil Iskra <kamil at dwd dot interkom dot pl>
- Date: Fri, 3 Jul 1998 21:03:40 +0200 (CEST)
- cc: egcs at cygnus dot com
On Wed, 1 Jul 1998, Carlo Wood wrote:
> It is a very common mistake to type '=' where '==' was intended.
> Using extra parentheses is a very logical way to make the code
> more clear in what you mean. Not only for the author itself,
> but also for others that read the code later and wonder if this
> is a typo/bug, or if it was intended (something not always clear
> from the context).
>
> My personal opinion is that this warning is so useful that I'd
> even object to move it to -pedantic warnings.
I don't think that's a good idea. -pedantic serves completely different
pupose:
@item -pedantic
Issue all the warnings demanded by strict ANSI standard C; reject
all programs that use forbidden extensions.
AFAIK, ANSI doesn't require any diagnostic in this case.
/ Kamil Iskra AmigaOS Linux/i386 Linux/m68k \
| GeekGadgets GCC maintainer UNIX system administrator |
| iskra@student.uci.agh.edu.pl kiskra@ernie.icslab.agh.edu.pl |
\ kamil@dwd.interkom.pl http://student.uci.agh.edu.pl/~iskra /