Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: On endianness, many #ifdefs, and the need thereof Date: Wed, 02 Oct 2019 12:54:21 -0700 Organization: None to speak of Lines: 18 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="bddf772ed55a11e50268662a0524f54c"; logging-data="7946"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jmywjOisL4z8jybrs6vlr" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:qdAG/yYUkqJb3Vna21oFl0o134w= sha1:nmSJvdhwdvMGhVk21Ey1tSSYyB8= Xref: csiph.com comp.lang.c++:68925 scott@slp53.sl.home (Scott Lurndal) writes: > David Brown writes: [...] >>The /compiler/ can handle it at compile time - it can figure out the >>result of this function at compile time and use that in optimisation. > > Can it? How does that work when you're cross-compiling to a different > architecture (like a microcontroller, for example)? Presumably the compiler knows the endianness of the target architecture it's generating code for. There might be an issue with the compiler not having that information soon enough, but it could certainly get the information if it's worthwhile. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */