Re: Some static about static
- From: goodTweetieBird <goodTweetieBird@xxxxxxxxxxx>
- Date: Wed, 2 Sep 2009 12:35:02 -0700 (PDT)
Thanks for posting.
What's "packed"? It's not a C or C++ keyword. Is it a macro? If so, whatWe use it to jam data together in structs where elements would
does it expand to?
otherwise fall on native size boundaries. It is useful to me when
moving data between pipes/queues and structs. For instance when
pulling data from a pipe I just give it the address of the packed
struct. If the struct were not packed I would need to use memcpy to
copy it into a struct piecewise instead of loading it directly from
the pipe. Saves some time and memory in my embedded system. It is
apparently supported by many compilers:
http://en.wikipedia.org/wiki/Data_structure_alignment
static faultMsgType faultMsg;
did not make it static, meaning it was still on the stack.
How do you determine this?
The struct is quite large and it caused the calling task to overflow
its stack allotment. Then I verified it by looking at memory with a
debugger.
This is not valid C, and shouldn't compile. What compiler are you using?
Mentor Graphics Microtek compiler. Apparently it has sufficient
thrust....
thanks,
jh
.
- Follow-Ups:
- Re: Some static about static
- From: Igor Tandetnik
- Re: Some static about static
- References:
- Some static about static
- From: goodTweetieBird
- Re: Some static about static
- From: Igor Tandetnik
- Some static about static
- Prev by Date: Re: Some static about static
- Next by Date: Re: Some static about static
- Previous by thread: Re: Some static about static
- Next by thread: Re: Some static about static
- Index(es):
Relevant Pages
|