"Unsequenced modification and access to 'p'" for:
func[p/102]( p++ ) ;
A quick search brought me to http://www.bionoren.com/blog/2013/07/unsequenced-modificatio... : 'Basically, the compiler is free to reorder anything and everything until it hits a “sequence point”. Things like return, if, assignment, variable declaration, etc are all sequence points.'In the parent code sample, it seems the compiler is free to execute "p++" before the "p/102" since there is no sequence point between them.
I was previously unaware of this undefined behavior. Thanks for this, rertrree!
Re:Branch-free FizzBuzz in Assembly
by pepijndevos on Saturday January 03, 2015 @04:29PM
(#8832064)
Have you looked at the generated ASM? I suspect printf contains a lot of branches. But then so might those syscalls I guess.
EDIT: I just noticed I have undefined behavior in my code.
Bonus internet points for the first one to point it out!