LWN.net Logo

Why learn C? (O'Reilly Radar)

Why learn C? (O'Reilly Radar)

Posted Jun 30, 2012 17:25 UTC (Sat) by tjc (subscriber, #137)
In reply to: Why learn C? (O'Reilly Radar) by dirtyepic
Parent article: Why learn C? (O'Reilly Radar)

Yes, and all those C11 socks start with an underscore (_Alignas, _Alignof, _Atomic, &c.) like some of their C99 predecessors. I realize there are reasons for this, but it's turning C into kind of an ugly language.


(Log in to post comments)

Why learn C? (O'Reilly Radar)

Posted Jul 1, 2012 5:04 UTC (Sun) by wahern (subscriber, #37304) [Link]

Most of those have non-prefixed versions which you can get by including a header. For example _Bool has <stdbool.h>, which does #define bool _Bool. For _Alignof include <stdalign.h> and get alignof. <stdatomic.h> does the same for many other types.

In C anything that starts with an underscore followed by a capital letter, or anything which begins with two underscores, is reserved for future language extensions. That way, new extensions won't break existing code. If you want the intuitive names, include the headers.

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