Deutsch English Français Italiano |
<ut10gu$2695n$2@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: David Brown <david.brown@hesbynett.no> Newsgroups: comp.lang.c Subject: =?UTF-8?B?UmU6IFdvcmQgRm9yIFRvZGF5OiDigJxVZ2xpZmljYXRpb27igJ0=?= Date: Fri, 15 Mar 2024 09:22:54 +0100 Organization: A noiseless patient Spider Lines: 22 Message-ID: <ut10gu$2695n$2@dont-email.me> 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> <20240314195148.755@kylheku.com> <878r2k40qv.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 15 Mar 2024 08:22:54 -0000 (UTC) Injection-Info: dont-email.me; posting-host="7521a6ab962105e84f4e48866803f6e1"; logging-data="2303159"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18V6OTS2UxSU2tQP4OUkQpF9gin2h3ZOqY=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cancel-Lock: sha1:mk/CSy7GZArd3tW7azWe/rcS3Nk= In-Reply-To: <878r2k40qv.fsf@nosuchdomain.example.com> Content-Language: en-GB Bytes: 2307 On 15/03/2024 04:44, Keith Thompson wrote: > Kaz Kylheku <433-929-6894@kylheku.com> writes: > [...] >>>> #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 > > Or they did know that and decided that the longer version would be clearer. > Or they did know, and decided they did not want a spurious warning when compiling with "-Wundef" that generates a warning before replacing undefined identifiers with 0 in #if directives. Personally, I always use -Wundef in my own code, because I think the "default to 0" treatment makes it far too easy for typos to go unnoticed. I have no idea if the glibc folk agree with that and like to use -Wundef themselves, or if they just like to make their code as "warning-proof" as possible.