[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warning: suggest parenthesis around assignment used as truth value
From: |
Rob Mahurin |
Subject: |
Re: warning: suggest parenthesis around assignment used as truth value |
Date: |
Thu, 12 Mar 2009 21:40:25 -0400 |
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
--
Rob Mahurin
Department of Physics and Astronomy
University of Tennessee 865 207 2594
Knoxville, TN 37996 address@hidden
Re: warning: suggest parenthesis around assignment used as truth value, Ben Abbott, 2009/03/13