Hello Gentlemen,
Much as I'm a fan of the GCC and rely on -Wall, I would like to suggest
to you that -Wparentheses should be split up, and things it checks/suggests
be moved out of -Wall. If this is not the right forum or if you'd rather
see this as a bug report, I'm happy to go where I'm point
On Dec 19, 2007 3:02 PM, <[EMAIL PROTECTED]> wrote:
> One last point. In looking for the rationale behind this warning, I searched
> for examples of it. I didn't find any discussion on this list. What I did
> find were many examples of people rototilling perfectly fine code, "improving"
> it by
On Wed, Dec 19, 2007 at 03:02:35PM -0500, [EMAIL PROTECTED] wrote:
> My specific candidate for exclusion from -Wall is this one:
>
> if (a && b || c && d)
>
> which yields (as you know) advice to parenthesize the two && pairs.
>
> I very much think this is unhelpful, counterproductive ad
Wednesday 19 December 2007 22:11:22 tarihinde Doug Gregor şunları yazmıştı:
> On Dec 19, 2007 3:02 PM, <[EMAIL PROTECTED]> wrote:
> > One last point. In looking for the rationale behind this warning, I
> > searched for examples of it. I didn't find any discussion on this list.
> > What I did fi
[EMAIL PROTECTED] writes:
> Much as I'm a fan of the GCC and rely on -Wall, I would like to suggest
> to you that -Wparentheses should be split up, and things it checks/suggests
> be moved out of -Wall. If this is not the right forum or if you'd rather
> see this as a bug report, I'm happy to go
Ian Lance Taylor wrote:
> I have no objection to splitting -Wparentheses into separate warnings
> controlled by separate options.
Thank you, Ian.
> > which yields (as you know) advice to parenthesize the two && pairs.
>
> That particular warning happened to find dozens of real errors when I
> My untested (and consequently firmly
> held) hypothesis is that
>
> 1) most combinations of && and || don't need parentheses because
>
> (a && b) || (c && d)
>
> is by far more common than
>
> a && (b || c) && d
>
> and, moreover, broken code fails at runtime, and
I dispute these cla
"James K. Lowden" <[EMAIL PROTECTED]> writes:
> > That particular warning happened to find dozens of real errors when I
> > ran it over a large code base. It may be noise for you, but I know
> > from personal experience that it is very useful.
>
> I would like to hear more about that, if you wou
Ian Lance Taylor wrote:
> A typical true positive looked more or less like
>
> if (a &&
> b || c)
http://www.jetcafe.org/jim/c-style.html
It's funny you should mention that. A warning about whitespace
indentation that's inconsistent with the expressed logic *would* be
helpful (and c
freetds.org> writes:
>
> Yes, I know beginners get confused by and/or precedence. But
> *every* language that I know of that has operator precedence places
> 'and' before 'or'.
FWIW, Bourne shell doesn't, && and || have equal precedence there.
That's a bit off-topic though, as it's not an argu
On 12/20/07, Ralf Wildenhues <[EMAIL PROTECTED]> wrote:
> freetds.org> writes:
> >
> > Yes, I know beginners get confused by and/or precedence. But
> > *every* language that I know of that has operator precedence places
> > 'and' before 'or'.
>
> FWIW, Bourne shell doesn't, && and || have equal
Paul Brook wrote:
>James K. Lowden wrote:
1) most combinations of && and || don't need parentheses because
(a && b) || (c && d)
is by far more common than
a && (b || c) && d
and, moreover, broken code fails at runtime, and
I dispute these claims.
The former may be statisti
> > Yes, I know beginners get confused by and/or precedence. But
> > *every* language that I know of that has operator precedence places
> > 'and' before 'or'.
>
> FWIW, Bourne shell doesn't, && and || have equal precedence there.
> That's a bit off-topic though, as it's not an argument against yo
Joe Buck wrote:
On Fri, Jan 11, 2008 at 09:34:29AM +0200, Rehno Lindeque wrote:
Just a note: Operator precedence is taught as logical AND comes before
OR in logic courses. So it is a sort of a standard mathematical
convention just like + and *. In fact, OR is even represented as a +
in some nota
On Fri, Jan 11, 2008 at 09:34:29AM +0200, Rehno Lindeque wrote:
> Just a note: Operator precedence is taught as logical AND comes before
> OR in logic courses. So it is a sort of a standard mathematical
> convention just like + and *. In fact, OR is even represented as a +
> in some notations. Howe
On Dec 19, 2007 3:02 PM, <[EMAIL PROTECTED]> wrote:
> My specific candidate for exclusion from -Wall is this one:
>
> if (a && b || c && d)
>
> which yields (as you know) advice to parenthesize the two && pairs.
To make this discussion a bit more concrete, the attached patch
removes this
Joe Buck <[EMAIL PROTECTED]> writes:
> A warning that flagged code like
>
> if (c1 || c2 && c3)
>...
>
> would swamp users in warnings, since this kind of code is extremely
> common, and this isn't the kind of thing that anyone who's not a total C
> beginner has trouble with.
That is what -
On Fri, Jan 11, 2008 at 03:24:46PM -0800, Ian Lance Taylor wrote:
> Joe Buck <[EMAIL PROTECTED]> writes:
>
> > A warning that flagged code like
> >
> > if (c1 || c2 && c3)
> >...
> >
> > would swamp users in warnings, since this kind of code is extremely
> > common, and this isn't the kind o
"Doug Gregor" <[EMAIL PROTECTED]> writes:
> To make this discussion a bit more concrete, the attached patch
> removes this particular warning from -Wparentheses and puts it into a
> new warning, -Wprecedence, that is not enabled by -Wall. This is
> slightly more fine-grained than what -Wparenthese
Ian Lance Taylor <[EMAIL PROTECTED]> writes:
> I'm inclined to approve this if -Wprecedence stays in -Wall, but I'd
> like to hear if anybody else has anything to say.
The name of the option is rather poor, IMHO. -Wparentheses warns about
precedences, so what is the difference to -Wprecedence?
Andreas Schwab wrote:
Ian Lance Taylor <[EMAIL PROTECTED]> writes:
I'm inclined to approve this if -Wprecedence stays in -Wall, but I'd
like to hear if anybody else has anything to say.
The name of the option is rather poor, IMHO. -Wparentheses warns about
precedences, so what is the differe
Ian Lance Taylor <[EMAIL PROTECTED]> writes:
| "Doug Gregor" <[EMAIL PROTECTED]> writes:
|
| > To make this discussion a bit more concrete, the attached patch
| > removes this particular warning from -Wparentheses and puts it into a
| > new warning, -Wprecedence, that is not enabled by -Wall. Thi
All,
Developer knowledge of operator precedence and the issue of what
they intended to write are interesting topics. Some experimental
work is described in (binary operators only I'm afraid):
www.knosof.co.uk/cbook/accu06a.pdf
www.knosof.co.uk/cbook/accu07a.pdf
The ACCU 2006 experiment provide
23 matches
Mail list logo