Path: utzoo!utgpu!cunews!cognos!geovision!pt From: pt@geovision.uucp (Paul Tomblin) Newsgroups: comp.lang.c Subject: Re: Style guides and portability Message-ID: <1332@geovision.UUCP> Date: 14 Jan 91 14:20:34 GMT References: <14824@smoke.brl.mil> <1991Jan13.182655.17672@athena.mit.edu> Reply-To: pt@geovision.gvc.com Distribution: comp Organization: GeoVision Corp., Ottawa, Ontario Lines: 23 scs@adam.mit.edu (Steve Summit) writes: >The only >problem I have with user-defined types in C is printing them. >If you have > int32 bigint; >do you print it with %d or %ld? (Come to think of it, this is >another strong argument in favor of "long int" over "int32".) Simple, you cast all your integer types to long, and printf them as %ld. {The cast probably isn't even needed, because it's a variadic function. If I remember correctly, variadic functions are type promoted the same way classic C functions are, integer types (char, int, unsigned, etc) are promoted to long, real types (float, double) are promoted to double. Anybody know what happens to "long double" types in variadic functions, or is "long double" not an ANSI-C type? -- Paul Tomblin, Department of Redundancy Department. ! My employer does The Romanian Orphans Support Group needs your help, ! not stand by my Ask me for details. ! opinions.... pt@geovision.gvc.com or {cognos,uunet}!geovision!pt ! Me neither.