Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for December 5, 2013
Deadline scheduling: coming soon?
LWN.net Weekly Edition for November 27, 2013
ACPI for ARM?
LWN.net Weekly Edition for November 21, 2013
Posted Apr 18, 2012 1:10 UTC (Wed) by jzbiciak (✭ supporter ✭, #5246)
It does, but it's so easy to forget some of these rules that it can lead to subtle, mind boggling errors -- errors that may not show up until you change compilers or compile flags, and may never evoke a warning from the compiler. The P_Rand() - P_Rand() example I gave elsewhere is a prime example, and I don't think anyone would have called John Carmack (or whoever wrote that idiom at id) an amateur.
So, while it's all well and good to say "Write tricky C only if you understand sequence points," there are plenty of non-tricky sequences that are nonetheless ill defined and subject to implementation defined or undefined behavior.
Throw in modern hardware and multithreading, and it's.... exciting. Sequence points only barely help you there. The Linux "memory barriers" document is an informative read.
Posted Apr 19, 2012 22:12 UTC (Thu) by BenHutchings (subscriber, #37955)
Posted Apr 21, 2012 15:50 UTC (Sat) by tjc (subscriber, #137)
Posted Apr 21, 2012 16:23 UTC (Sat) by BenHutchings (subscriber, #37955)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds