This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56815] New: void pointer arithmetic
- From: "d.v.a at ngs dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 02 Apr 2013 16:57:38 +0000
- Subject: [Bug c++/56815] New: void pointer arithmetic
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815
Bug #: 56815
Summary: void pointer arithmetic
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: d.v.a@ngs.ru
int main()
{
void *p = 0;
p += 1;
}
$ gcc -std=c++98 source.cpp
source.cpp: In function 'int main()':
source.cpp:4:7: warning: pointer of type 'void *' used in arithmetic
[-Wpedantic]
p += 1;
^
Why only warning? It must be error. Other compilers reject this code.