Deutsch English Français Italiano |
<20240314195148.755@kylheku.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <433-929-6894@kylheku.com> Newsgroups: comp.lang.c Subject: Re: Word For Today: =?UTF-8?Q?=E2=80=9CUglification=E2=80=9D?= Date: Fri, 15 Mar 2024 03:17:51 -0000 (UTC) Organization: A noiseless patient Spider Lines: 65 Message-ID: <20240314195148.755@kylheku.com> References: <uso6or$3t3jn$3@dont-email.me> <20240311202758.193@kylheku.com> <86v85opw22.fsf@linuxsc.com> <87v85o4i1v.fsf@nosuchdomain.example.com> <87msr04afd.fsf@nosuchdomain.example.com> <lIMIN.574792$xHn7.491768@fx14.iad> <87il1o44oi.fsf@nosuchdomain.example.com> Injection-Date: Fri, 15 Mar 2024 03:17:51 -0000 (UTC) Injection-Info: dont-email.me; posting-host="8c47a74d86a279d136db227d771d8013"; logging-data="2205442"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rXLv2fSY3xtLr1pWyNNW9pkaudMoYOY8=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:lxtWg6PG0bQhoDGs48UkahUh2kI= Bytes: 3505 On 2024-03-15, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote: > scott@slp53.sl.home (Scott Lurndal) writes: >> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes: >>>Keith Thompson <Keith.S.Thompson+u@gmail.com> writes: >>>[...] >>>> For context, here's the entire file from my system (Ubuntu 24.0.4, >>>> package libc6-dev:amd64 2.35-0ubuntu3.6). I get the impression that the >>>> author(s) decided not to use memset to avoid the required #include, >>>> which might increase compilation times for code that indirectly includes >>>> this header. (I offer no opinion on whether that's a good tradeoff.) >>>[...] >>> >>>An older version did use memset(). It was changed to use a loop in >>>1997, with a commit message that included: >>> "Don't use memset to prevent prototype trouble, use simple loop." >>>It may have been to avoid problems with pre-ANSI C compilers that didn't >>>support prototypes. That's still speculation on my part. >> >> Here's the full fc20 version: >> $ rpm -q -f /usr/include/bits/select.h >> glibc-headers-2.18-19.fc20.x86_64 >> >> > [...] >> #if defined __GNUC__ && __GNUC__ >= 2 Whoever wrote this didn't know that if __GNUC__ doesn't exist, it will expand as 0, which is false, so this is equivalent to just #if __GNUC__ >= 2 > [...] >> #else /* ! GNU CC */ > [...] >> #endif /* GNU CC */ > [...] > > I don't see that in the GNU glibc git repo, even on branches with > "fedora" in their names. Perhaps it's a change applied by Red Hat and > not propagated upstream. (Though I'm not sure why Red Hat would need to > allow for glibc not being compiled by gcc.) That it's checking for GNU C at least 2 suggests it is an old patch. If you look at the source directory for Fedora's package, you see there are a bunch of patches that get applied: https://src.fedoraproject.org/rpms/glibc/tree/rawhide Now if we go to "f20", a heck of lot more patches were applied: https://src.fedoraproject.org/rpms/glibc/tree/f20 Now, don't waste your time; it's not in any of those patches (I looked). f20 references glibc-2.18.tar.gz, and that's where that code is found, in this file: ./glibc-2.18/sysdeps/x86/bits/select.h -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca