cgcc

Cool GCC built-ins


I've heard of a lot of cool GCC extensions and built-in functions over the years, but I always wind up forgetting about them before thinking of using them.

What are some cool GCC extensions and built-ins, and some real-life examples of how to put them to use?


Solution

  • GCC provides many features as compiler extensions, off the top of mind and frequently used by me are:

    Statement Expressions
    Designated Initializers

    There are many more documented on the GCC website here.

    Caveat: However, using any form of compiler extensions renders your code non-portable across other compilers so do use them at that risk.