Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!decwrl!shelby!neon!Gang-of-Four!dkeisen From: dkeisen@Gang-of-Four.Stanford.EDU (Dave Eisen) Newsgroups: comp.lang.c Subject: Re: not really Re: Style guides and portability Message-ID: <1991Jan16.172439.15205@Neon.Stanford.EDU> Date: 16 Jan 91 17:24:39 GMT References: <1991Jan13.182655.17672@athena.mit.edu> <10608@hydra.Helsinki.FI> <1991Jan15.054540.1466@athena.mit.edu> Sender: news@Neon.Stanford.EDU (USENET News System) Organization: Sequoia Peripherals Lines: 36 In article <1991Jan15.054540.1466@athena.mit.edu> scs@adam.mit.edu writes: > >In article <10608@hydra.Helsinki.FI>, Lars Wirzenius asks: >>Is there any problem in using >> printf("%ld", (long) bigint) >>other than that it's clumsy? > >None whatsoever (as long as bigint is known to map to a built-in, >integral type, which in the problem under discussion, it was). >This is a much better solution. (It's not even all that clumsy.) It sorta defeats the purpose, doesn't it? The point of using a type like int32 is to avoid hardcoding the current compiler's idea of what a long looks like into the code and here you are using "lf" and "long" thousands of times all over your code. If you wanted to go this route, maybe something like #define BIGINT_FORMAT "ld" #define BIGINT_TYPE long would be appropriate. It doesn't seem worth it to me. I expect I'll regret that decision someday. -- Dave Eisen "I strongly suspect the "right man" could go a 1447 N. Shoreline Blvd. *long* way toward solving your "problem". Mountain View, CA 94043 --- Dan Mocsney, offering himself for the job (415) 967-5644 dkeisen@$Gang-of-Four.Stanford.EDU