My favorites | Sign in
Project Home Downloads Wiki Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 218: IDE Error Check For == vs. = in logic compare statements
4 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  dmel...@gmail.com


Sign in to add a comment
 
Reported by itstheme...@gmail.com, Mar 10, 2010
The IDE does not notice the difference between:

if (x=1) 

and the correct

if (x==1)

Just an enhancement.

Thanks.
Mar 10, 2010
#1 e.fa...@wayoda.org
Right, no compiler does this.

The compiler the IDE uses would put out a warning (I think) if it weren't called with
option -w which supresses warnings.

This is one of the things you always have to lookout for as a programmer.

It is not a bug that could be fixed in the Arduino-code.
Eberhard

Mar 10, 2010
#2 clvrm...@gmail.com
Yeah, this is completely valid code, though it is rarely (if ever) what the coder
intended.

A workaround (other than providing a place for warnings to go, so we can leverage the
intelligence of the compiler or preprocessor) would be to leverage the GUI code
highlighter to make this a special case.

I can see an argument for making this one of those places in the GUI where we warn
you you are doing something you probably don't want to do.  Given the target audience
of the GUI, anyway.
Sign in to add a comment

Powered by Google Project Hosting