Thread (10 messages) flat view 10 messages, 4 authors, 2016-08-11

Re: sizeof(struct ...)

From: René Scharfe <hidden>
Date: 2016-08-11 19:55:50

Andy Whitcroft schrieb:
This structure represents an on-disk/on-the-wire thing, should we not be
specifying it in some architecture neutral way?  You are going to get
the length right in the case of tail padding but not in the face of any
other padding internally.

You see packing attributes applied to similar things in the kernel.
Perhaps they are relevant here?
Is there not some kind of attribute thing we can apply to this structure
to prevent the padding?  You see that in the kernel from time to time.

struct foo {
} __attribute__((packed));
Yes, that would be nice, but unfortunately __attribute__ is no standard
C.  Is there really a compiler that inserts padding between arrays of
unsigned chars?

Thanks,
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help