]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/gcc/extensions-to-the-c-language-family/arithmetic-on-void-and-function-pointers.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gcc / extensions-to-the-c-language-family / arithmetic-on-void-and-function-pointers.rst
CommitLineData
c63539ff
ML
1..
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.
5
6.. index:: void pointers, arithmetic, void, size of pointer to, function pointers, arithmetic, function, size of pointer to
7
8.. _pointer-arith:
9
10Arithmetic on void- and Function-Pointers
11*****************************************
12
13In GNU C, addition and subtraction operations are supported on pointers to
14``void`` and on pointers to functions. This is done by treating the
15size of a ``void`` or of a function as 1.
16
17A consequence of this is that ``sizeof`` is also allowed on ``void``
18and on function types, and returns 1.
19
20.. index:: Wpointer-arith
21
22The option :option:`-Wpointer-arith` requests a warning if these extensions
3ed1b4ce 23are used.