Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: A thought of C Date: Thu, 23 Apr 2026 09:14:52 -0700 Organization: A noiseless patient Spider Lines: 18 Message-ID: <86a4ut4ps3.fsf@linuxsc.com> References: <3a3462bdd72c4ed9d392a78b7d369a7b5ccc3b04.camel@gmail.com> <10s01e1$384ct$1@dont-email.me> <10s06q2$39rhn$1@dont-email.me> <10s2a2u$3t0f5$1@dont-email.me> <10s2fhc$3ug5h$1@dont-email.me> <10s2h5f$3uctl$1@dont-email.me> <10s2oq0$19am$1@dont-email.me> <10s2tfe$2lvm$1@dont-email.me> <10s34f6$542f$1@dont-email.me> <10s3akj$7ajg$1@dont-email.me> <10s3otn$bk6v$1@dont-email.me> <10s5atn$2sck7$1@paganini.bofh.team> <86ik9j63hc.fsf@linuxsc.com> <10sal8n$2967c$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Thu, 23 Apr 2026 16:14:53 +0000 (UTC) Injection-Info: dont-email.me; posting-host="096db26766e75ae3d0da9ffd77dfc80c"; logging-data="3309331"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fJCAAPw1FaHHBfnhUutlZ6RQ+7lPgznY=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:YZJ7QS12CZHBBb2+7euXHAE6uGA= sha1:m4tlLnEZOEXs+Sfl18xSfMs3s88= Xref: csiph.com comp.lang.c:397867 scott@slp53.sl.home (Scott Lurndal) writes: > IMO, most "undefined behavior" in the C specification was due to > implementation differences between the C compilers/linkers that > existed at the time. There are different kinds of undefined behavior. I think it is more common for differences between different tool sets to be put in the category of implemenation-defined behavior than undefined behavior. Some circumstances, such as indexing past the end of an array, are inherently undefined behavior, and really couldn't be anything else. In some cases a construct is labeled UB not because of differences in existing tools but because the ISO committee wanted to allow a level of freedom in future tool sets that is more than what IDB can provide. I haven't done any sort of systematic study, but my sense is that UB arising only from differences in existing implementations is more at the low end of the histogram than the high end.