emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 37889523278: Add new `swap` macro and use it


From: Po Lu
Subject: Re: master 37889523278: Add new `swap` macro and use it
Date: Mon, 15 Jan 2024 21:56:58 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Mon, 15 Jan 2024 01:32:38 +0000
>> From: Gregory Heytings <gregory@heytings.org>
>> cc: Po Lu <luangruo@yahoo.com>, stefankangas@gmail.com, emacs-devel@gnu.org
>> 
>> 
>> >> Further proving my point, neither variant of typeof compiles with Sun C 
>> >> 5.8, a C99 compiler that does presently produce working Emacs builds.
>> >
>> > Which system configuration uses this compiler?  When was that compiler 
>> > released?  Are there newer versions of that compiler that do support one 
>> > of these keywords?
>> >
>> 
>> Sun C 5.8 is part of Sun Studio 11, which was released in 2005.  Sun 
>> Studio 11 is an (optional) extension package for Solaris 10 / SunOS 
>> 5.10... on which GCC (3.4.3) is installed by default.
>> 
>> Sun C 5.9, part of Sun Studio 12 (which is likewise an optional extension 
>> package for that same operating system), released in 2007, supports the 
>> typeof operator.
>
> Thanks.  Given this information, I don't see why we should be bothered
> with the deficiencies of Sun C 5.8.

For the same reason we bother with the deficiencies of GCC 3.4.3 and
other C compilers and OSes.  It is not enough that Emacs work on some
combination of supported system and compiler, it must work on _all_
combinations of C compiler and supported system, provided that the C
compiler is reasonable, for which we have a definition provided by the
C99 Standard.

No doubt Emacs has failed to fulfill this strict (albeit not extreme)
measure of portability on occasion, but such instances are far and few
between, and their causes we promptly fix after being apprised of them.
Between that and the fact that we have never willfully undermined the
quality of our code in this respect, Emacs has thus far held up to its
side of the bargain remarkably well.  My point being that a `swap'
macro, which is also generally discountenanced by C programmers, is not
sufficiently compelling a reason to depart from doing so.

This practice of ours is so well established as to justify a mention in
the GNU Coding Standards identifying Emacs by name.  (standards)Using
Extensions:

  An exception to this rule are the large, established programs (such as
  Emacs) which run on a great variety of systems.  Using GNU extensions
  in such programs would make many users unhappy, so we don't do that.

Before you is one user who would be unhappy in such an event!

FWIW:

Sun Studio 5.8 and 5.12 were once standard on systems at my workplace,
but we have since moved to a different C compiler that has rendered both
and GCC redundant, and does not implement "__typeof__" in its default
mode of operation, despite being usually configured for compatibility
with Sun C.  I will try to establish if its defaults are capable of
compiling Emacs tomorrow.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]