Path: csiph.com!aioe.org!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Compiling and linking code from different places in the file system Date: Wed, 07 Mar 2018 10:11:05 -0800 Organization: None to speak of Lines: 27 Message-ID: References: <6oSnC.178019$eQ7.108635@fx46.am4> <87o9k055d2.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="1b894f1eb6e5831da76153652d9177c0"; logging-data="9016"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183PNHQWmr2EhPYdXfjM0X+" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:BLKV8qX8SDoYjkpEZNyre3tM/og= sha1:rioB1T4RHRNajbJ91KdPKiYpP04= Xref: csiph.com comp.lang.c:127444 supercat@casperkitty.com writes: [...] > If instead a program can be designed so that it will work with any common > microprocessor platform where char, short, and long are 8, 16, and 32 bits, > respectively, are consistently big-endian or little-endian, and allow such > representation to be accessed using lvalues of any integer type which are > visibly derived in the context where they are used, and if such code > requires that either BIG_ENDIAN or LITTLE_ENDIAN be pre-declared, then > the code could be expected to be usable on any development system meeting > those requirements without having to be tested on every single one of them. Consider. Writing. Shorter. Sentences. Any program that assumes 32-bit long will fail on many of the systems I use, where long is 64 bits. How about writing code that doesn't assume how wide long is? No conforming implementation can predefine BIG_ENDIAN or LITTLE_ENDIAN. And most code doesn't need to care about endianness. I wouldn't mind having a way to determine the current system's endianness, (maybe something in ), but it's not a huge deal. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"