Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: printf and time_t Date: Sun, 11 Jan 2026 22:47:40 -0800 Organization: None to speak of Lines: 44 Message-ID: <874iorqqcz.fsf@example.invalid> References: <10jfol6$2u6r8$1@news.xmission.com> <10jfs23$2liif$1@dont-email.me> <20260105105138.00005f0a@yahoo.com> <10jgbp7$2vdjt$1@news.xmission.com> <10jgdu9$2t8dh$1@nntp.eternal-september.org> <10jhkso$3c9r2$3@nntp.eternal-september.org> <20260106112938.00004446@yahoo.com> <10jj9st$3jbe4$2@dont-email.me> <20260106200522.000015ea@yahoo.com> <87h5sy2rlb.fsf@example.invalid> <87qzs1gliq.fsf@example.invalid> <20260108012620.000041a9@yahoo.com> <87bjj5gei4.fsf@example.invalid> <20260108023846.0000260c@yahoo.com> <10jpi8h$15aea$1@dont-email.me> <20260109141859.00004f22@yahoo.com> <10jv3rb$15aea$2@dont-email.me> <20260111132015.000026ad@yahoo.com> <86zf6kkjw0.fsf@linuxsc.com> <20260111235104.00001463@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Mon, 12 Jan 2026 06:47:41 +0000 (UTC) Injection-Info: dont-email.me; posting-host="4f47478b15b0a336821a595eb474bce0"; logging-data="2278377"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19AYZl8XxPg2Kv+6yChZuAL" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:UJrE4u2v3/VoAXnZMhetYzc45MQ= sha1:c+GW5gdW2OeDw5iXqPSM53k522g= Xref: csiph.com comp.lang.c:396358 Michael S writes: > On Sun, 11 Jan 2026 11:51:43 -0800 > Tim Rentsch wrote: >> Michael S writes: [...] >> > Properties are: >> > a) uint32_t aliased to 'unsigned long' >> > b) 'unsigned int' is at least 32-bit wide. >> >> It seems unlikely that any implementation would make such a >> choice. Can you name one that does? > > Four out of four target for which I write C programs for living in this > decade: > - Altera Nios2 (nios2-elf-gcc) > - Arm Cortex-M bare metal (arm-none-eabi-gcc) > - Win32-i386, various compilers > - Win64-Amd64,various compilers I find that surprising. I just tried a test program that prints the name of the type uint32_t is an alias for (using _Generic), and it's alias to unsigned int on every implementation I tried. (Your properties are limited to systems with 32-bit int and long.) For an implementation where int and long are both 32 bits, it wouldn't have surprised me for uint32_t to be an alias either for unsigned int or for unsigned long, and I wouldn't care either way beyond idle curiosity, but all the implementations I've tried choose to use unsigned int. > Well, if I would be pedantic, then in this decade I also wrote several > programs for Arm32 Linux, where I don't know whether uint32_t is alias > of 'unsigned int' or 'unsigned long', few programs for AMD64 Linux, > where I know that uint32_t is an alias of 'unsigned long' and may be one > program for ARM64 Linux that is the same as AMD64 Linux. > But all those outliers together constitute a tiny fraction of the code > that I wrote recently. One advantage of my approach is that I don't have to know or care what the underlying type of uint32_t is. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */