TITLE: the strictest data alignment requirements PROBLEM: wil@ittpub.nl (Wil Evers) Does anyone know if the draft C++ standard defines a way to find the type that has the most stringent alignment requirements, or can I assume using double here is always good enough? RESPONSE: clamage@Eng.Sun.COM (Steve Clamage), 15 Nov 95 The DWP does not provide a portable way (that I can think of, but I may be insufficiently clever) to find the type with the strongest alignment requirements. You can't assume type double has the strongest requirements. If you make a union with all the built-in types (including some representative function pointer types) that will probably be good enough, but is still not guaranteed. You don't have to provide char (because it must have the weakest requirement) or both signed and unsigned versions of integer types (because the alignment requirements for practical purposes must be the same). So something like this union Align { int i; long l; float f; double d; long double ld; void *vp; long *lp; long double* ldp; int (*ifp)(int); long double (*dfp)(long double); }; would probably do. I have no particular justification for omitting some of the omitted types; you could add more if you like. I suppose an implementation could exist for which this Align type would not be sufficient for the static allocation trick, but I don't know of any in practice. ("In theory, theory and practice agree; in practice, they don't".)