Re: Word For Today: “Uglification”

Liste des GroupesRevenir à cl c  
Sujet : Re: Word For Today: “Uglification”
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.c
Date : 15. Mar 2024, 04:49:07
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86il1op5uk.fsf@linuxsc.com>
References : 1 2 3 4
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
Kaz Kylheku <433-929-6894@kylheku.com> writes:
>
[some editing of white space done]
>
On 2024-03-12, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>
From /usr/include/<<arch>>/bits/select.h on my Debian system:
>
  #define __FD_ZERO(s)                                                  \
    do {                                                                \
      unsigned int __i;                                                 \
      fd_set *__arr = (s);                                              \
>
This assignment has value;  it checks that, loosely speaking,
s is an "assignment compatible" pointer with a fd_set *,
so that there is a diagnostic if the macro is applied to
an object of the wrong type.
>
More to the point, if the macro is applied to a value of the wrong
type.
>
      for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i)  \
        __FDS_BITS (__arr)[__i] = 0;                                    \
>
Here, I would have done memset(__arr, 0, sizeof *__arr).
>
That assumes that it is the entire fd_set that needs to be zeroed,
which may not be right.  Note the call to the __FDS_BITS() macro.
>
Better:
>
  #define __FD_ZERO(s) (                                                  \
    (void) memset(                                                        \
      __FDS_BITS( (fd_set*){(s)} ), 0, sizeof __FDS_BITS( (fd_set*){0} )  \
    )                                                                     \
  )
>
This definition:  avoids introducing any new identifiers;  checks
that the argument s yields an assignment compatible pointer;  and
provides a macro that can be used as a void expression (unlike the
original macro definition, which can be used only as a statement).
>
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.  [...]

Yes, it seems clear from the (snipped) source that the authors
deliberately avoided using memset(), perhaps so as not to have
an unwanted dependency.

My comments were meant in the sense of comparing one revision to
another, and about macro definitions generally.  They were not
meant to say anything specific about the context in which the
original macro was defined, both because it is not one I have
easy access to and because it doesn't affect the general nature
of my comments.

Date Sujet#  Auteur
12 Mar 24 * Word For Today: “Uglification”63Lawrence D'Oliveiro
12 Mar 24 +* Re: Word For Today: “Uglification”3Keith Thompson
12 Mar 24 i`* Re: Word For Today: “Uglification”2Lawrence D'Oliveiro
12 Mar 24 i `- Re: Word For Today: “Uglification”1Keith Thompson
12 Mar 24 +* Re: Word For Today: “Uglification”11Kaz Kylheku
14 Mar 24 i`* Re: Word For Today: “Uglification”10Tim Rentsch
14 Mar 24 i `* Re: Word For Today: “Uglification”9Keith Thompson
15 Mar 24 i  +* Re: Word For Today: “Uglification”2Keith Thompson
15 Mar 24 i  i`- Re: Word For Today: “Uglification”1David Brown
15 Mar 24 i  +* Re: Word For Today: “Uglification”5Keith Thompson
15 Mar 24 i  i`* Re: Word For Today: “Uglification”4Keith Thompson
15 Mar 24 i  i `* Re: Word For Today: “Uglification”3Kaz Kylheku
15 Mar 24 i  i  `* Re: Word For Today: “Uglification”2Keith Thompson
15 Mar 24 i  i   `- Re: Word For Today: “Uglification”1David Brown
15 Mar 24 i  `- Re: Word For Today: “Uglification”1Tim Rentsch
12 Mar 24 +* Re: Word For Today: “Uglification”47James Kuyper
12 Mar 24 i`* Re: Word For Today: “Uglification”46Lawrence D'Oliveiro
12 Mar 24 i +- Re: Word For Today: “Uglification”1Lawrence D'Oliveiro
12 Mar 24 i +* Re: Word For Today: “Uglification”37Kaz Kylheku
12 Mar 24 i i`* Re: Word For Today: “Uglification”36Richard Kettlewell
12 Mar 24 i i +* Re: Word For Today: “Uglification”22David Brown
12 Mar 24 i i i+* Re: Word For Today: “Uglification”20Anton Shepelev
12 Mar 24 i i ii`* Re: Word For Today: “Uglification”19bart
12 Mar 24 i i ii +* Re: Word For Today: “Uglification”17Anton Shepelev
12 Mar 24 i i ii i`* Re: Word For Today: “Uglification”16bart
12 Mar 24 i i ii i `* Re: Word For Today: “Uglification”15Kaz Kylheku
13 Mar 24 i i ii i  `* Re: Word For Today: “Uglification”14bart
13 Mar 24 i i ii i   +* Re: Word For Today: “Uglification”12Keith Thompson
13 Mar 24 i i ii i   i+* Re: Word For Today: “Uglification”10bart
13 Mar 24 i i ii i   ii+* Re: Word For Today: “Uglification”7Michael S
13 Mar 24 i i ii i   iii+* Re: Word For Today: “Uglification”4Keith Thompson
13 Mar 24 i i ii i   iiii`* Re: Word For Today: “Uglification”3David Brown
13 Mar 24 i i ii i   iiii `* Re: Word For Today: “Uglification”2Keith Thompson
13 Mar 24 i i ii i   iiii  `- Re: Word For Today: “Uglification”1David Brown
13 Mar 24 i i ii i   iii+- Re: Word For Today: “Uglification”1David Brown
13 Mar 24 i i ii i   iii`- Re: Word For Today: “Uglification”1Kaz Kylheku
13 Mar 24 i i ii i   ii`* Re: Word For Today: “Uglification”2Keith Thompson
13 Mar 24 i i ii i   ii `- Re: Word For Today: “Uglification”1bart
13 Mar 24 i i ii i   i`- Re: Word For Today: “Uglification”1Nick Bowler
13 Mar 24 i i ii i   `- Re: Word For Today: “Uglification”1Kaz Kylheku
12 Mar 24 i i ii `- Re: Word For Today: “Uglification”1Kaz Kylheku
13 Mar 24 i i i`- Re: Word For Today: “Uglification”1Blue-Maned_Hawk
13 Mar 24 i i `* Re: Word For Today: “Uglification”13Lawrence D'Oliveiro
13 Mar 24 i i  +* Re: Word For Today: “Uglification”11Keith Thompson
13 Mar 24 i i  i`* Re: Word For Today: “Uglification”10Richard Kettlewell
13 Mar 24 i i  i `* Re: Word For Today: “Uglification”9Keith Thompson
13 Mar 24 i i  i  +* Re: Word For Today: “Uglification”7Lawrence D'Oliveiro
14 Mar 24 i i  i  i+- Re: Word For Today: “Uglification”1Kaz Kylheku
14 Mar 24 i i  i  i+- Re: Word For Today: “Uglification”1Keith Thompson
14 Mar 24 i i  i  i`* Re: Word For Today: “Uglification”4Lawrence D'Oliveiro
14 Mar 24 i i  i  i `* Re: Word For Today: “Uglification”3Keith Thompson
14 Mar 24 i i  i  i  +- Re: Word For Today: “Uglification”1Richard Kettlewell
14 Mar 24 i i  i  i  `- Re: Word For Today: “Uglification”1Kaz Kylheku
19 Jun 24 i i  i  `- Re: Word For Today: “Uglification”1Tim Rentsch
13 Mar 24 i i  `- Re: Word For Today: “Uglification”1Kaz Kylheku
12 Mar 24 i `* Re: Word For Today: “Uglification”7James Kuyper
12 Mar 24 i  `* Re: Word For Today: “Uglification”6Lawrence D'Oliveiro
13 Mar 24 i   +- Re: Word For Today: “Uglification”1Keith Thompson
13 Mar 24 i   `* Re: Word For Today: “Uglification”4James Kuyper
13 Mar 24 i    `* Re: Word For Today: “Uglification”3Lawrence D'Oliveiro
14 Mar 24 i     +- Re: Word For Today: “Uglification”1Kaz Kylheku
14 Mar 24 i     `- Re: Word For Today: “Uglification”1James Kuyper
12 Mar 24 `- Re: Word For Today: “Uglification”1Kaz Kylheku

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal