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: Thu, 08 Mar 2018 09:58:15 -0800 Organization: None to speak of Lines: 31 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="24717"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199Iu7WC4ET7pArXmZ8Lcfx" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:aNXh+tgruXd25HEtU+IRyj6qKts= sha1:6z2t79wUFk8amhY7vx85XlrWeWQ= Xref: csiph.com comp.lang.c:127488 David Brown writes: [...] > And then name one where you could not do this to get valid int32_t and > uint32_t types: > > #include > > #if INT_MIN == -2147483647 > typedef int int32_t; > typedef unsigned int uint32_t; > #elif LONG_MIN == -2147483647 > typedef long int int32_t; > typedef unsigned long int uint32_t; > #elif SCHAR_MIN == -2147483647 > typedef signed char int32_t; > typedef unsigned char uint32_t; > #else > #error No support for 32-bit sized types > #endif You mean -2147483648, not -2147483647. And the expression -2147483648 can be problematic. I'd check the value of INT_MAX (and I'd likely use 0x7fffffff because it's easier to see typos). [...] -- 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"