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: Sort char array Date: Thu, 10 Oct 2019 11:05:29 -0700 Organization: None to speak of Lines: 42 Message-ID: References: <8636g5ap5m.fsf@linuxsc.com> <20191007131948.c9f28d44bcd105e7a153069a@g{oogle}mail.com> <2xFmF.867378$yH4.431562@fx18.am4> <20191007174244.385138503569a8bc6d4eec9d@g{oogle}mail.com> <20191008022725.36fbd95aa45ba185290e5e11@gmail.com> <1q_mF.841756$Zy3.585129@fx33.am4> <20191009020207.b533aa1c6d95f44eb314ffc1@gmail.com> <20191010030322.2da081faffb190e4f5370362@gmail.com> <65b3e46e-3d3e-4a4b-8e5d-7bcc908019b6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="ae453da06a2b0ba7b51610fa3f87a41c"; logging-data="14384"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18uT5t7dhyyuinf04yU3Cqr" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:TkhNslDX2rLXv1UB7W5g8tM9bBI= sha1:ZeO/QVJ4BPtqOIe6sds7VX+M+ks= Xref: csiph.com comp.lang.c:146846 already5chosen@yahoo.com writes: [...] > I think, your understanding is wrong. > C standards and pre-standard books define 'int' as the most efficient > signed integer type on a given machine. At some point it was changed > to the most efficient signed integer type with at least 15 bits of > magnitude. Incorrect. The phrase "most efficient" is not used. The 1975 C manual says "Integers (int) are represented in 16-bit 2's complement notation"; it was based (mostly) on a single implementation. K&R1 (1978) says int is "an integer, typically reflecting the natural size of integers on the host machine". It includes a table showing the sizes of types on 4 different implementations, with int being 16, 36, or 32 bits. The current standard says A "plain" int object has the natural size suggested by the architecture of the execution environment (large enough to contain any value in the range INT_MIN to INT_MAX as defined in the header ). and requires elsewhere that INT_MIN <= -32767 and INT_MAX >= +32767. But the phrase "natural size" is vague enough to be unenforceable. Clearly the natural size on a 64-bit system would be 64 bits (especially for CPUs that don't have 32-bit operations), but most C compilers for such systems have 32-bit int. > So, on IA-32 platform 256-bit int would be clearly non-standard. It would be conforming apart from the "natural size" clause. In practice IA-32 implementations do use 32-bit int (or *maybe* 16-bit int), but they would do so even without the "natural size" clause. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */