Post by pbaI am not sure you read what I wrote : what I'm trying to find out is
what is left out and what gets in when you use /Za. Za is advertised
to disable MS extensions and is supposed to be used to check for
portability problems, and portability assumes - of course - you will
not be including any windows specific headers. To be more specific, I
expect the compilation of the following program to fail (note there
#include <iostream>
class __declspec(novtable) base
{
virtual void beep() {}
};
class test : public base
{
public
void beep() {};
};
int main(void)
{
test *p = new test();
p->beep();
return (EXIT_SUCCESS);
}
According to the C++ standard, names with a double underscore are reserved
for compiler specific extensions. By definition, these are non-portable.
Thus, to adapt your remarks, "portability assumes - of course - you will
not be including any double underscore identifiers."
/Za doesn't automatically prevent your code from compiling when you use
these; I presume this is because the C++ standard makes provision for such
extensions. I agree that a switch that made the compiler reject all
extensions would be convenient for some purposes, but there just isn't one.
As previously indicated, you can find out what /Za covers by looking it up
in the Help file. When I do so, the /Za entry has a link to "Microsoft
Extensions to C and C++". That should tell you what /Za excludes (since this
may vary with compiler version, however, I recommend you look it up in the
help that came with your compiler).
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_microsoft_extensions_to_c.asp
--
John Carson