[Bug c++/56815] void pointer arithmetic

2013-04-04 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #22 from Manuel López-Ibáñez 2013-04-04 10:38:06 UTC --- (In reply to comment #21) > Manuel, I'm adding the LangEnabledBy, to match the documentation. Thanks. > > Now, I'm not sure to understand the existing lines (many): > > ped

[Bug c++/56815] void pointer arithmetic

2013-04-04 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #21 from Paolo Carlini 2013-04-04 10:12:11 UTC --- Manuel, I'm adding the LangEnabledBy, to match the documentation. Thanks. Now, I'm not sure to understand the existing lines (many): pedantic ? OPT_Wpedantic : OPT_Wpoint

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 Paolo Carlini changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #19 from Paolo Carlini 2013-04-03 13:49:08 UTC --- Excellent. I have a patch in testing.

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #18 from Jason Merrill 2013-04-03 13:45:57 UTC --- void arithmetic is a deliberate GNU extension, so it should be a pedwarn rather than permerror.

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #17 from Paolo Carlini 2013-04-03 12:18:37 UTC --- Ok, let's handle that separately.

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #16 from Manuel López-Ibáñez 2013-04-03 12:12:15 UTC --- BTW, I also see that in c-family/c.opt -Wpointer-arith is not LangEnabledBy(C ObjC C++ ObjC++,Wpedantic). If it was, then -Werror=pedantic will automatically handle -Werror=poi

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 Manuel López-Ibáñez changed: What|Removed |Added CC||jason at gcc dot gnu.org --- Comme

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #14 from Paolo Carlini 2013-04-03 11:57:37 UTC --- I see. Thus I guess I will test & send both versions, pedwarn to permerror in c-common.c and permerror to pedwarn in the C++ front-end.

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #13 from Manuel López-Ibáñez 2013-04-03 11:53:23 UTC --- (In reply to comment #9) > Ok Manuel, thanks. I'm not completely convinced by the > > else if ((pedantic || warn_pointer_arith) > > which is protecting the permerrors (a -W

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #12 from Paolo Carlini 2013-04-03 11:50:27 UTC --- Sorry, I meant p += 1 and avoid p++. You got the point.

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #11 from Paolo Carlini 2013-04-03 11:35:55 UTC --- In that case we can have a pedwarn instead of a permerror in the C++ front-end and restore some consistency. Still I find weird that those people in the wild currently must a

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Co

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 Paolo Carlini changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #8 from Manuel López-Ibáñez 2013-04-03 09:40:30 UTC --- (In reply to comment #7) > In practice the warning (a pedwarn) is emitted by code shared with the C > front-end, the error (a permerror, thus with -fpermissive it can be demoted

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 Paolo Carlini changed: What|Removed |Added CC||manu at gcc dot gnu.org --- Com

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread d.v.a at ngs dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 __vic changed: What|Removed |Added Severity|normal |minor

[Bug c++/56815] void pointer arithmetic

2013-04-03 Thread jasonwucj at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #6 from Chung-Ju Wu 2013-04-03 07:33:03 UTC --- (In reply to comment #5) > (In reply to comment #4) > > From gcc manpage, the option '-std=' specifies base standard and > > accept some GNU extensions that do not contradict it.

[Bug c++/56815] void pointer arithmetic

2013-04-02 Thread d.v.a at ngs dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #5 from __vic 2013-04-03 06:24:43 UTC --- (In reply to comment #4) > From gcc manpage, the option '-std=' specifies base standard and > accept some GNU extensions that do not contradict it. > > If you would like to issue warn

[Bug c++/56815] void pointer arithmetic

2013-04-02 Thread jasonwucj at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 Chung-Ju Wu changed: What|Removed |Added CC||jasonwucj at gmail dot com --- Co

[Bug c++/56815] void pointer arithmetic

2013-04-02 Thread d.v.a at ngs dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #3 from __vic 2013-04-02 17:10:15 UTC --- (In reply to comment #2) > void* arithmetic is a GCC extension. But why my examples are treated differently?

[Bug c++/56815] void pointer arithmetic

2013-04-02 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #2 from Andrew Pinski 2013-04-02 17:04:31 UTC --- Use -pedantic-errors if you want to have rejected invalid standard C++ code. void* arithmetic is a GCC extension.

[Bug c++/56815] void pointer arithmetic

2013-04-02 Thread d.v.a at ngs dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815 --- Comment #1 from __vic 2013-04-02 17:00:23 UTC --- Slightly modified: int main() { void *p = 0; p++; } $ gcc -std=c++98 source.cpp source.cpp:4:6: error: arithmetic on a pointer to void p++; ~^