[openib-general] Re: [PATCH] ibdm nits and a few questions
Michael S. Tsirkin
mst at mellanox.co.il
Thu Jul 7 01:31:48 PDT 2005
Quoting r. Bernhard Fischer <rep.nop at aon.at>:
> Is ibdm supposed to be compilable with pure ISO c++ compilers, btw?
If you care about this, compile with -pedantic.
> There is at least one place which uses a variable sized array which AFAIK
> is not valid ISO c++.
I think Bernhard is right, it isnt, VLA is a C99 feature but not a C++ feature.
http://www.open-std.org/jtc1/sc22/open/n2356/decl.html
For other incompatibilities between ISO C and ISO C++, see
http://david.tribble.com/text/cdiffs.htm#C99-vla
~>cat > xxx.c
void foo(int argc)
{
int foo[argc];
}
~>g++ -c -pedantic xxx.c
xxx.c: In function `void foo(int)':
xxx.c:3: warning: ISO C++ forbids variable-size array `foo'
--
MST
More information about the general
mailing list