[Main]
Title=Arithmetic on void and Function Pointers

[Top]
In GNU C, addition and subtraction operations are supported on pointers to
<CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE> and on pointers to functions.  This is done by treating the
size of a <CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE> or of a function as 1.
<BR><BR>
A consequence of this is that <CODE><A HREF="$$INFOLINK(keywords/sizeof)">sizeof</A></CODE> is also allowed on <CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE>
and on function types, and returns 1.
<BR><BR>
The option <B>'-Wpointer-arith'</B> requests a warning if these extensions
are used.
