On Thu, 2007-02-15 at 01:16 +0530, Debarshi Ray wrote:
> What is the style to be followed while using __attribute__ ((packed))
> and typedef with structures? I find both the following two variants in
> the code:
> 
> a. struct __attribute__ ((packed)) _foo {
>     ...
>     };
>     typedef struct _foo foo;
> 
> b. typedef struct foo {
>     ...
>     } __attribute__ ((packed)) foo_t;
> 
> Which is the preferred way to do this?
> 
> I personally prefer the first one because:
> (i) typedef struct _foo foo; has been followed for most of the major
> structures like PedDisk, PedPartition, etc..
> (ii) Having the __attribute__ in the first line is more readable since
> the information is available immediately. One does not have to scroll
> down to see it.
> 
> What are your views?

I prefer (a) because it is more readable.

-- 
David Cantrell <[EMAIL PROTECTED]>
Red Hat / Westford, MA

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to