Open GoogleCodeExporter opened 8 years ago
Yeah, the real problem is the compiler warning, which is stupid. I don't esp.
want to add any of these options since there's no real situation that could
have an alignment issue, that is:
* if you use malloc or alloca, you're ok: those are maximally aligned
* if you are using a derived type (a generated type), then you will have to
declare it as such, and the C compiler will know the alignment requirements.
Finally, I wonder, does this warning turn up potential misuses like?
ProtobufCMessage msg = { &some_object_descriptor, 0, NULL };
SomeObject *obj = &msg; // terribly wrong, but the warning will trigger
but this is a very hit-or-miss situation since on many platforms pointers have
the highest alignment requirements.
Is there any other helpful side-effect of this warning?
Original comment by lahike...@gmail.com
on 17 Jan 2012 at 2:49
Original issue reported on code.google.com by
brunorij...@gmail.com
on 28 Dec 2011 at 8:19