gcc加什么选项能使其完全遵循于ansi而不支持gnu的额外扩展?解决办法

gcc加什么选项能使其完全遵循于ansi而不支持gnu的额外扩展?
我用了   -ansi选项,好像不管用
对无类型指针的加运算还能通过而不报错

------解决方案--------------------
禁止无类型指针的加运算是C99标准

gcc -std=C99

------解决方案--------------------
禁止无类型指针的加运算是C99标准

gcc -std=c99
------解决方案--------------------
我试了一下c99这个选项,不可以噢
------解决方案--------------------
另经试验,不论是4.1.2还是3.2.3,不论是加-std=c99还是不加,不论是不是加了-Wall选项,无类型指针的加运算还都能通过,并且连Warning也没有。

那么怎么编译会出错呢?把它当成C++程序编译,就出错了。所以也并不像是GCC开发有问题……

#include <stdio.h>
int main()
{
void *p = NULL;
printf( "size = %d\n ", sizeof(p));
printf( "%p\n ", p);
p += 5;
printf( "%p\n ", p); /* 结果地址偏移量就是5字节 */
return 0;
}

------解决方案--------------------
我查了一下C99的标准,但没有见到具体说明void *的加运算会有什么后果。标准上只是说
For addition, either both operands shall have arithmetic type, or one operand shall be a pointer to an object type and the other shall have integer type.
以及
For the purposes of these operators, a pointer to an object that is not an element of an array behaves the same as a pointer to the first element of an array of length one with the type of the object as its element type.

编译器不报错,似乎也没有什么违反标准的地方吧?
------解决方案--------------------
对不起,错了:
禁止无类型指针的加运算是ISO C++标准
g++ -ansi
http://community.****.net/Expert/topic/5605/5605276.xml?temp=.9066126
------解决方案--------------------
看来GCC的表现是正常的。
------解决方案--------------------
> > 禁止无类型指针的加运算是ISO C++标准

我记得C中也是这样。

------解决方案--------------------
mark

------解决方案--------------------
学习~