2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. index:: void pointers, arithmetic, void, size of pointer to, function pointers, arithmetic, function, size of pointer to
10 Arithmetic on void- and Function-Pointers
11 *****************************************
13 In GNU C, addition and subtraction operations are supported on pointers to
14 ``void`` and on pointers to functions. This is done by treating the
15 size of a ``void`` or of a function as 1.
17 A consequence of this is that ``sizeof`` is also allowed on ``void``
18 and on function types, and returns 1.
20 .. index:: Wpointer-arith
22 The option :option:`-Wpointer-arith` requests a warning if these extensions