There is a new 8051 C compiler in beta test that beats Keil's compiler by 35% code size, and 14% speed, on the Dhrystone benchmark. And, there is no need to select a memory model or use special keywords to control data placement.
More details here: www.htsoft.com/.../silabs8051beta
Regarding the example:
some_function(++a, ++a);
Who really writes code like this? Are the (questionable) optimizations of any side effects from such a line ever worth it?
In our case, all people MUST undergo an intial period of training to ensure that the prescribed development rules are understood before they are let loose at writing code. Hence expressions like the above, and any resultant assumptions are avoided.
Simple.
Who really writes code like this?
People who don't know better (and you might have to debug their code at some point), people who don't care and people who are actively malicious.
Are the (questionable) optimizations of any side effects from such a line ever worth it?
Some people may think that writing a program with as few keystrokes as possible is a worthwhile goal.
Granted, the example was blaringly obvious and should make anyone halfway familiar with C cringe. Any compiler with half a brain should emit a warning. However, MS VC++ doesn't seem to care about a = a++; ... other compilers I use do find this worth a warning.
"People who don't know better (and you might have to debug their code at some point), people who don't care and people who are actively malicious."
I take your point on that one. I have come across similar dubious practice code in legacy projects.
Not so long ago I was scanning over some code of a (supposedly senior) team member. There was a block of believable code, in a released project, that had a comment just above it stating:
/* THIS CODE DOES NOT WORK */
Not too surprisingly, the team member wasn't part of my team for much longer!
Not too surprisingly, the team member wasn't part of my team for much longer!<p>
Well, the question is: If the code (obviously) didn't work, why wasn't this caught during testing ? Or was the comment outdated and the code correct ?
No, not simple. Besides assuming that you do manage to teach them all to behave, you also assume that you really are in control of all paths of source code onto your table.
Did you see my example? The library in question wasn't written inhouse, but because of policy reasons (sellers like partnerships, since it looks so nice on the web page...) you sometime have to integrate code you have suddenly got in your knee.
Sometimes management buy products that you may have to take care of. Sometimes your products needs to be integrated with a customers product. Sometimes, someone decides to buy a magic library that will greatly decrease the development time of a new feature. Many ways to get new and strange code inside the house. Not all written by really competent developers.