https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123388
Bug ID: 123388
Summary: Please split -Wpointer-arith
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Pointer arithmetic on void* is an old and widely accepted GNU extension.
Programs rely on it everywhere.
On the other hand, arithmetic on NULL is less useful, and some programs may
want to stay away from it.
It would be useful to split -Wpointer-arith in three different flags:
-Wpointer-arith-null
-Wpointer-arith-void
-Wpointer-arith-function
So that one could enable the -null and -function ones, but disable the -void
one.