LWN.net Logo

Nice example...

Nice example...

Posted Nov 18, 2008 17:38 UTC (Tue) by jzbiciak (✭ supporter ✭, #5246)
In reply to: Nice example... by daney
Parent article: pcc seeks contributions to reach 1.0 milestone

I don't come down on the side of "GCC == BAD" at all. What I was pointing out, though, is that the C standard and its wiggle room are at odds with things like kernels and multithreaded programs. If you can only rely on what the C standard guarantees, then it's much harder to do useful things efficiently.

More aggressive optimizations will rely on this wiggle room and sometimes break things. That's a headache for kernel developers. Sure, GCC may get fixed, but breaking to begin with was an annoyance. If the break causes subtle problems, diagnosing the issue could be very difficult.

This is where a simpler compiler can be more effective. If it provides very simple semantics (rather than the extraordinary wiggle room the standard provides), it becomes easier to reason about the correctness of the program. Yes, it's less portable to other compilers, but as long as the compiler itself is portable, what's the issue?

After all, you don't see many Linux builds that don't use GCC (although there are a few...).


(Log in to post comments)

Nice example...

Posted Nov 18, 2008 19:07 UTC (Tue) by dlang (✭ supporter ✭, #313) [Link]

multi-threaded programming will be in much better shape (standards wise) in a couple years.

defining this area is one of the bigger changes in the new POSIX, C, and C++ standards that are nearing completion (POSIX is complete, C is expected next year, C++ sometime after that)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds