I was using Microsoft VC++ Express 2005 with SP1.
Printable View
That is very weird. We are essentially using the same compiler with compiler extensions turned on, but the results are different. Have you checked with my test program?
Actually I'll have to reboot to do that but i'll give it a shot. brb
I received the compiler error for this like expected. Then I modified it for a typedef:Code:#include <iostream>
int main()
{
std::cout << sizeof int << std::endl;
}
And it compiled without error using VC++ Express 2005.Code:#include <iostream>
typedef int int32;
int main()
{
std::cout << sizeof int32 << std::endl;
}
This has been fun, bit of a mind boggle huh
Thanks, I can confirm that. Since the behaviour remains the same even with compiler extensions turned off, I conclude that this is an area where the compiler simply does not conform to the standard.