Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Portable 16 bit binary integer write Date: Mon, 19 Sep 2016 15:44:38 -0700 Organization: None to speak of Lines: 29 Message-ID: References: <50a1e8f4-4fb3-4491-97d0-54768bf28685@googlegroups.com> <0b757bbb-0494-44cb-bd5a-26f117aaa404@googlegroups.com> <2cf666d7-0755-4c70-adad-07dbafc2b2e7@googlegroups.com> <09cb4413-16a6-4b63-89d0-9dafe56562f6@googlegroups.com> <68e53f3a-5fcc-44fc-90c4-bcf8dc3db680@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="13415"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sOQehjcylfNCJ7pJKDx7C" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:sRz84klndacEYoAr6HgZMPkPQM4= sha1:ohKIUreVt05OY6+Rem8ImtK4ceQ= Xref: csiph.com comp.lang.c:93828 David Brown writes: [...] > Of curiosity, do you know of any implementations that actually have > extended integer types? No. > gcc has __int128_t on some targets (typically > 64-bit targets), but it is not an extended integer type. I can't > remember exactly why it does not qualify as an extended integer type > (there is no way to express constants of that type, unless it happens to > match long long, but I don't know if that is an issue for qualifying as > an extended integer type). On a system with 64-bit long long, an extended 128-bit integer type, if it exists in both signed and unsigned types, would require [u]intmax_t to be 128 bits. gcc makes [u]intmax_t 64 bits. Supposedly the x86_64 ABI requires [u]intmax_t to be 64 bits. Making [u]intmax_t would require coordination between the compiler and the standard library, as well as among compilers that expect to generate code passing values of those types to functions compiled by other compilers. -- 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"