• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [2.2] Cant get __attribute__ ((__packed__)) to work
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [2.2] Cant get __attribute__ ((__packed__)) to work


  • Subject: Re: [2.2] Cant get __attribute__ ((__packed__)) to work
  • From: Mark Wagner <email@hidden>
  • Date: Tue, 15 Nov 2005 09:44:59 -0800

On 11/14/05, Dave Camp <email@hidden> wrote:
> I'm updating some old code that was last built with Project Builder
> and gcc 2.95. I've got some enums that need to be 1 byte, not an int
> (the typedefs are used in structs that are sent to a device over USB).

Try this:

typedef char fooEnum;
typedef enum
{
       foo             = 0x10
} _fooEnum;

int main (int argc, const char * argv[])
{
       fooEnum myFoo = foo;
       printf("size = %d", sizeof(fooEnum));
    return 0;
}

--
Mark Wagner
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [2.2] Cant get __attribute__ ((__packed__)) to work
      • From: Alexander von Below <email@hidden>
References: 
 >[2.2] Cant get __attribute__ ((__packed__)) to work (From: Dave Camp <email@hidden>)

  • Prev by Date: Breakpoints that never go away
  • Next by Date: Building a plugin as a Universal Binary causes local relocation entries in non-writable section error
  • Previous by thread: [2.2] Cant get __attribute__ ((__packed__)) to work
  • Next by thread: Re: [2.2] Cant get __attribute__ ((__packed__)) to work
  • Index(es):
    • Date
    • Thread