[lkml]   [2005]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectone pragma pack vs. many, many __attribute__((packed))
Seems like a big annoyance, but gcc on some platforms (arm) will
generate different code for
pragma pack(1)
vis the corresponding more verbose alternative ie specifying
on each structure one by one. Presumably there are good reasons for why
packing them across the whole file does not mean you can necessarily
read them when they aren't aligned (my imagination is not that good)

Although it makes the code more verbose to individually call out packing
on each structure, I don't see any reasonable alternative that would
work (at least on arm) as I have to deal with structures coming in off
the network that are packed - and in some cases not aligned on 2 or 4
byte boundaries either. special case parsing them off the wire (as
opposed to accessing them with their structure field names) would be
worse, and copying them into a temp buffer would be worse ... are there
no reasonable magic compile options or pragmas that will have the effect
of attribute__((packed)) without being so verbose?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-10-27 21:49    [W:1.955 / U:1.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site