octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warning: suggest parenthesis around assignment used as truth value


From: Ben Abbott
Subject: Re: warning: suggest parenthesis around assignment used as truth value
Date: Fri, 13 Mar 2009 22:12:19 +0800


On Mar 13, 2009, at 9:40 AM, Rob Mahurin wrote:

On Mar 12, 2009, at 9:08 PM, Ben Abbott wrote:
Can someone explain what this warning is intended to imply?

        warning: suggest parenthesis around assignment used as truth value

This is a gcc warning? The idiom
        if (x=1) { ... }
is legal and useful but often a typo for
        if (x==1) { ... }
Extra parentheses
        if ((x=1)) { ... }
apparently suppress the warning.

Cheers,
Rob

ok, I'm convinced that you are correct. It doesn't appears more likely that the error is from gcc.

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]