Re: Mr. Seligman, please show me “ Implicit_Size_of_Int32 == -16 ”.



=?UTF-8?Q?Jeff=E2=98=A0Relf?= <Jeff_Relf@xxxxxxxxx> wrote:

Re: This code of mine:
â?? #pragma warning( disable: 4007 4189 4430 4508 )
WinMain( int, int, int, int ) {
const __int32 Int32 = 0 ; const __int64 Int64 = 0 ;

int Implicit_Size_of_Int32 = int( & Int64 ) - int( & Int32 );
// Breaking here, â?? Implicit_Size_of_Int32 == 8 â??.
} â??.

I'm taking about VC++ 8.0's default alignment, of course.
Can you, using the code above, get â?? Implicit_Size_of_Int32 == -16 â??,
Mr. Seligman ?

Yes, as soon as you turn on runtime checks (/RTC), and of course
things change further with other optimizations.

Your code produces 8 in a debug build with all optimizations and such
off, but that's very nearly useless information.

--
--------- Scott Seligman <scott at <firstname> and michelle dot net> ---------
Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well armed lamb contesting the vote.
-- Benjamin Franklin
.



Relevant Pages

  • Re: DEFAULT CFLAGS SETTING
    ... Unlike some linux distributions where using CFLAGS and CXXFLAGS are encouraged, it's discouraged here because it generates a lot more variation in having to check through errors, and many times the levels of optimization used my system users is counterproductive to the purpose of optimizing. ... int f{ ... an alias set for the node. ... since the version of gcc the base system works with isn't bleeding edge it won't support all processor types / optimizations available in later versions of gcc. ...
    (freebsd-questions)
  • Re: When is "volatile" used instead of "lock" ?
    ... int count = random.Next; ... I was expecting the JIT to do much better optimizations (looping x times ... by using a register for the duration of the loop. ... with local variables. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: A Bug in gcc or asm/string.h ?
    ... in the asm template: ... static inline int strcmp ... In this way GCC puts everything is cached in register back to memory when ... optimizations can't hurt here. ...
    (Linux-Kernel)
  • Re: c / c++ : is it end of era ?
    ... Dave Vandervies a écrit: ... int main ... gcc 3.3.6 ... I explicitely disabled optimizations. ...
    (comp.lang.c)
  • Re: c / c++ : is it end of era ?
    ... int main ... sys 0m0.040s ... I explicitely said that you should NOT set any optimizations, ... #define MAXITER 10000000 ...
    (comp.lang.c)