Re: #pragma unpack



The WinCE compiler supports #pragma pack to control how primary datatypes
are aligned in a struct or class.

Each data type has a natural alignment:

Data type | Natural alignment on 32 bit platforms | Alignment on 64bit
------------------------------------------------------------------------
__int8 | 1 byte aligned (any adress is ok) | <same>
__int16 | 2 byte aligned | <same>
__int32 | 4 byte aligned | <same>
__int64 | 4 byte aligned | 8 byte
aligned


Using #pragma back you can change this alignment to any power of 2.

For more info check out MSDN:
http://msdn2.microsoft.com/en-us/library/2e70t5y1(VS.80).aspx


"buzz" <bzburr@xxxxxxxxxxxx> wrote in message
news:38f9ebd8-21bc-4ceb-ac6c-81d5988a438c@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hello
i have inherited a evc++ project

Upon compilation there are numerous c468 errors for unknown pragmas
Notably
"unpack" and "pop pack" surrounding typedefs for structures


can someone please point me in the correct direction so i can compile
without these warnings ?

My understanding is that in the application these pragmas do an
important job :)

Regards and thanks

Buzz


.



Relevant Pages

  • Re: request for feedback: making foreign function calls to C printf-style functions safer
    ... - compiler would report that. ... syntax for such a feature, but we are talking about an optional pragma, ... fine even after the format specifier syntax had been extended. ... compiler should check for in the format string. ...
    (comp.lang.modula2)
  • Re: include file question
    ... Where did you read that #pragma once is obsolete? ... because it suggests that what you need is some kind of weird compiler hack to make your ... inside the header file to prevent multiple execution of the contents. ... documentation about Objective C, which is a language which is NOT the C++ language, has ...
    (microsoft.public.vc.mfc)
  • Re: include file question
    ... First off I first read that you could keep the compiler ... But then I read that #pragma once is obsolete? ... The #include guards are portable since the beginning of time, ... Note that some headers use neither because they are ...
    (microsoft.public.vc.mfc)
  • Re: Ada checks suppression thanks to compilation options and Ada conformity
    ... One text book describes "pragma" as a "directive to the ... the compiler -- and indicate that compilers are allowed to ignore ... But this doens't apply to pragma Suppress, ... specify a compiler command-line option to suppress all checks, ...
    (comp.lang.ada)
  • Re: Packages private parts and protected types
    ... unneeded bodies which Ada95 solved with a pragma. ... a source file containing that body. ... accidental error to result in the compiler accepting a package without ...
    (comp.lang.ada)