Path: csiph.com!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 19:18:41 -0800 Organization: None to speak of Lines: 48 Message-ID: References: <6oSnC.178019$eQ7.108635@fx46.am4> <87o9k055d2.fsf@bsb.me.uk> <13a67039-e46b-4337-a1a3-058210e55b6e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="d5db3c990c5a8317a11173691196aced"; logging-data="21455"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19YbnwgsOTV03fySTI5TCui" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:0eTmX39UsCJOWElZ7V9n2/iS+28= sha1:puknfZXYORJYwjt2DdsRfPG+cHk= Xref: csiph.com comp.lang.c:127460 supercat@casperkitty.com writes: > On Wednesday, March 7, 2018 at 2:01:32 PM UTC-6, Keith Thompson wrote: [...] >> Yes, but int32_t and uint32_t do exist now. Are you looking for new and >> improved ways to update the C90 standard? They did that, and it's >> called C99 (and C11). > > Some embedded platforms have a limited range of compilers available. If > one needs to update the code for a piece of existing hardware which uses > an obscure platform, it may not be possible to use a C99 compiler. It wasn't clear that you were talking about workaround for ancient compilers. See, for example, . > [...] but I'm curious what > justification there is for code that would require "long" to be 64 bits. You were talking about code that assumes long is 32 bits; such code would break on many of the systems I use. I prefer to assume that long is at least 32 bits, since that's what the language guarantees. [...] >> Is the lack of predefined BIG_ENDIAN and LITTLE_ENDIAN macros (however >> they're spelled) a real problem for people writing such code? It's not >> hard to incorporate that into a configuration script. > > Not every build system uses Unix. How does the phrase "configuration script" imply Unix? > A configuration script will only be usable on build systems that support the > tools it's designed to work with. A text file that says to invoke the > compiler in a way that pre-defines either BIG_ENDIAN or LITTLE_ENDIAN will > work on any compiler that allows macros to be pre-defined at the time of > invocation. Sure, that would work too. (You can think of that text file as a trivial configuration script if you like.) Making sure that it's defined correctly is left as an exercise. [...] -- 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"