I think you're wrong, muntoo.
It's legal C code, and NXC should indeed support that too.
Already since the falsly as "obsfucated" decried chess program, IIRC.
;)
this should work also:
doc-helmut wrote:It's legal C code, and NXC should indeed support that too.
I meant that NXC doesn't support it yet. I have nothing against ACDC.
Of course, I do have something against obfuscation (unless I'm trying to write obfuscated code on purpose).
Commit to LEGO Mindstorms Robotics Stack Exchange: bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
no muntoo, it normally should.
The reason why I posted it of course is that I observed that it actually doesn't. Why else should I post it? it's a bug!
Your postings really don't help along.
What's that all about "obsfucation" with this issue? It's a simple right-to-left concatening of assignments!
But mostly because of the type of error message. It thinks the code is wrong (though it isn't) and therefore doesn't even attempt to compile it. (When it cannot compile it correctly it usually ends up being some gibberish together with some NBC code. (Or doesn't even notice it as seen several times ; ) ))
Once upon a time NXC did not allow an assignment to be an expression (i.e., something that returns a value that could then be used by something else). Now it does in a lot of cases but not all cases. I probably will not spend a lot of time perfecting this since there are many, many, many, many ways you can work around this compiler limitation. Ditto for when += does or does not work. If you want to use a real C compiler you could try NXTOSEK. Before I get around to these kind of problems I will probably get around to implementing API functions for the Tetrix controllers. Please do not start holding your breath but if you have already started you should exhale and breathe normally!