O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

GCC Extensions

One of the constants of GNU products is a huge number of features. gcc has an incredible number of extensions available. They can help improve your code, but they can also destroy portability if you target a platform that does not have gcc or you are not using gcc on Mac OS X.

Here are a handful of interesting extensions:

  • long long and unsigned long long: quadword (i.e., 64-bit) integers are treated as first class citizens. You can perform basic math (+,-,*,/), modular arithmetic, and bitwise operations with them.

  • Complex numbers: in C++ you can create complex numbers as a first class type, but gcc C has them built in.

  • Variable length automatic arrays: like you can use in C++, declaring the size of a stack-based array at runtime: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required