On Thu, Apr 15, 2010 at 12:38 PM, Marco d'Itri <md@xxxxxxxx> wrote: > You made alpha users sad. > > ----- Forwarded message from Michael Cree <mcree@xxxxxxxxxxxx> ----- > > From: Michael Cree <mcree@xxxxxxxxxxxx> > ../depmod.c:1312 > (gdb) list > 200 int __attribute__ ((pure)) native_endianness() > 201 { > 202 /* Encoding the endianness enums in a string and then reading that > 203 * string as a 32-bit int, returns the correct endianness > automagically. > 204 */ > 205 return (char) *((uint32_t*)("\1\0\0\2")); > 206 } > > > Yeah, nice programming guys. Allocate a string, i.e. an array of > char, which the compiler will merely byte align and then read it > back as a long word which must be long word aligned. And the > programmer thinks he is so smart that he descibes it > as "automagically"! Doh. There's no reason to be rude. /Andreas -- To unsubscribe from this list: send the line "unsubscribe linux-modules" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html