GCC-Isms

Introduction

I've always had somewhat mixed feelings about GNU C. I've been using
it since back in the 2.xx days, and have seen it improve over the years.
Besides the fact that it's free, it makes a really nice cross compiler.
On the downside, it's poorly supported on most platforms except ia32, and
it also propagates what it calls "C extensions", most of which should be
called "C abominations".

GNU C Extensions

The following is an example of my favorite "GCC C extensions". For
reference, the descriptions were pulled from the gcc info pages.

Arithmetic on `void'- and Function-Pointers

In GNU C, addition and subtraction operations are supported on
pointers to `void' and on pointers to functions. This is done by
treating the size of a `void' or of a function as 1.

A consequence of this is that `sizeof' is also allowed on `void' and
on function types, and returns 1.

The option `-Wpointer-arith' requests a warning if these extensions
are used.