• Re: "A diagram of C23 basic types"

    From David Brown@21:1/5 to Michael S on Mon Apr 21 20:34:20 2025
    On 19/04/2025 22:15, Michael S wrote:
    On Sat, 19 Apr 2025 17:15:42 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    On 19/04/2025 09:46, Janis Papanagnou wrote:
    On 17.04.2025 17:56, David Brown wrote:

    But anyway, the newest breakthrough is thorium
    nuclear clocks, which IIRC are 5 orders of magnitude more stable
    than cesium clocks. (And probably 5 orders of magnitude more
    expensive...)

    I've not heard of Thorium based clocks. But I've heard of
    "optical clocks" that are developed to get more precise and
    more stable versions of atomic clock times.


    It was only last year that a good measurement of the resonant
    frequencies of the Thorium 229 nucleus was achieved - the science bit
    is done, now the engineering bit needs to be finished to get a
    practical nuclear clock.




    Record my prediction: it's not going to happen.



    I don't know enough about Thorium 229 nuclear resonances to be able to
    predict one way or the other. Do you have a good reason or reference
    for your thoughts here?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Keith Thompson on Tue Apr 22 01:07:27 2025
    On Mon, 21 Apr 2025 14:28:30 -0700
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    David Brown <david.brown@hesbynett.no> writes:
    [...]
    I don't know enough about Thorium 229 nuclear resonances to be able
    to predict one way or the other. Do you have a good reason or
    reference for your thoughts here?

    Can you PLEASE take this somewhere else? (Or drop it, I don't care.)

    Don't read anything into the fact that I replied to one particular participant in the thread.


    There are two types of usenet groups:
    - groups that suffer from significat amount of OT discussions
    - dead

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to David Brown on Tue Apr 22 00:28:41 2025
    On Mon, 21 Apr 2025 20:34:20 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    On 19/04/2025 22:15, Michael S wrote:
    On Sat, 19 Apr 2025 17:15:42 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    On 19/04/2025 09:46, Janis Papanagnou wrote:
    On 17.04.2025 17:56, David Brown wrote:

    But anyway, the newest breakthrough is thorium
    nuclear clocks, which IIRC are 5 orders of magnitude more stable
    than cesium clocks. (And probably 5 orders of magnitude more
    expensive...)

    I've not heard of Thorium based clocks. But I've heard of
    "optical clocks" that are developed to get more precise and
    more stable versions of atomic clock times.


    It was only last year that a good measurement of the resonant
    frequencies of the Thorium 229 nucleus was achieved - the science
    bit is done, now the engineering bit needs to be finished to get a
    practical nuclear clock.




    Record my prediction: it's not going to happen.



    I don't know enough about Thorium 229 nuclear resonances to be able
    to predict one way or the other. Do you have a good reason or
    reference for your thoughts here?


    Michael's principle.
    If you don't know what it means, search comp.arch archives.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From candycanearter07@21:1/5 to Michael S on Tue Apr 22 19:30:03 2025
    Michael S <already5chosen@yahoo.com> wrote at 22:07 this Monday (GMT):
    On Mon, 21 Apr 2025 14:28:30 -0700
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    David Brown <david.brown@hesbynett.no> writes:
    [...]
    I don't know enough about Thorium 229 nuclear resonances to be able
    to predict one way or the other. Do you have a good reason or
    reference for your thoughts here?

    Can you PLEASE take this somewhere else? (Or drop it, I don't care.)

    Don't read anything into the fact that I replied to one particular
    participant in the thread.


    There are two types of usenet groups:
    - groups that suffer from significat amount of OT discussions
    - dead


    From what I've seen, comp.ibm.pc.action and rec.arts.comics.creative
    have plenty of on topic threads. Not that I mind OT threads much.
    --
    user <candycane> is generated from /dev/urandom

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Michael S on Sun Apr 27 12:05:16 2025
    Michael S <already5chosen@yahoo.com> writes:

    On Wed, 02 Apr 2025 16:59:59 +1100
    Alexis <flexibeast@gmail.com> wrote:

    Thought people here might be interested in this image on Jens
    Gustedt's blog, which translates section 6.2.5, "Types", of the C23
    standard into a graph of inclusions:

    https://gustedt.wordpress.com/2025/03/29/a-diagram-of-c23-basic-types/

    That's a little disappointing.
    IMHO, C23 should have added optional types _Binary32, _Binary64,
    _Binary128 and _Binary256 that designate their IEEE-754 namesakes.
    Plus, a mandatory requirement that if compiler supports any of IEEE-754 binary types then they have to be accessible by above-mentioned names.

    I see where you're coming from, but I disagree with the suggested
    addition; it simultaneously does too much and not enough. If
    someone wants some capability along these lines, the first step
    should be to understand what the underlying need is, and then to
    figure out how to accommodate that need. The addition described
    above creates more problems than it solves.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Lawrence D'Oliveiro on Mon Apr 28 07:52:10 2025
    On 18/04/2025 00:18, Lawrence D'Oliveiro wrote:
    On Wed, 16 Apr 2025 23:13:58 +0100, Richard Heathfield wrote:

    1) No account is taken of the 11-day shift in September 1752.

    root@debian10:~ # ncal -s IT 10 1582
    October 1582
    Su 17 24 31
    Mo 1 18 25
    Tu 2 19 26
    We 3 20 27
    Th 4 21 28
    Fr 15 22 29
    Sa 16 23 30


    $ ncal 9 1752
    September 1752
    Mo 18 25
    Tu 1 19 26
    We 2 20 27
    Th 14 21 28
    Fr 15 22 29
    Sa 16 23 30
    Su 17 24

    So what?

    The fact that ncal knows about the 11-day shift doesn't mean that
    the code I posted knows about it. In the code I posted, no
    account is taken of the 11-day shift in September 1752.

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Tim Rentsch on Mon Apr 28 16:27:38 2025
    On Sun, 27 Apr 2025 12:05:16 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    Michael S <already5chosen@yahoo.com> writes:

    On Wed, 02 Apr 2025 16:59:59 +1100
    Alexis <flexibeast@gmail.com> wrote:

    Thought people here might be interested in this image on Jens
    Gustedt's blog, which translates section 6.2.5, "Types", of the C23
    standard into a graph of inclusions:

    https://gustedt.wordpress.com/2025/03/29/a-diagram-of-c23-basic-types/ >>

    That's a little disappointing.
    IMHO, C23 should have added optional types _Binary32, _Binary64,
    _Binary128 and _Binary256 that designate their IEEE-754 namesakes.
    Plus, a mandatory requirement that if compiler supports any of
    IEEE-754 binary types then they have to be accessible by
    above-mentioned names.

    I see where you're coming from,

    I suppose, you know it because you followed my failed attempt to improve
    speed and cross-platform consistency of gcc IEEE binary128 arithmetic.
    Granted, in this case absence of common name for the type was much
    smaller obstacle than general indifference of gcc maintainers.
    So, yes, on the "producer" side the problem of absence of common name
    was annoying but could be regarded as minor.

    Apart from being a "producer", quite often I am on the other side,
    wearing a hat of consumer of extended precision types. When in this
    role, I feel that the relative weight of inconsistent type names is
    rather significant. I'd guess that it is even more significant for
    people whose work, unlike mine, is routinely multi-platform. I would
    not be surprised if for many of them it ends up as main reason to
    refrain completely from use IEEE binary128 in their software; even when
    it causes complications to their work and when the type is
    readily available, under different names, on all platforms they care
    about.

    but I disagree with the suggested
    addition; it simultaneously does too much and not enough. If
    someone wants some capability along these lines, the first step
    should be to understand what the underlying need is, and then to
    figure out how to accommodate that need. The addition described
    above creates more problems than it solves.

    IMHO, a need for a common name for IEEE binary128 exists for quite some
    time. For IEEE binary256 the real need didn't emerge yet. But it will
    emerge in the hopefully near future.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Scott Lurndal on Tue Apr 29 02:10:11 2025
    [ Just noticed this post while catching up in my backlog, so I'm not
    sure my questions/comments have already been addressed elsewhere. ]

    On 16.04.2025 22:04, Scott Lurndal wrote:
    [...]

    Back in the mainframe days, it was common to use julian dates
    as they were both concise (5 BCD digits/20 bits) and sortable.

    YYDDD

    If time was neeeded, it was seconds since midnight in a reference
    timezone.

    I don't quite understand the rationale behind all that said above.

    "YYDDD" was used without century information? How is that useful?
    (I assume it's just the popular laziness that later lead to all the
    Y2k chaos activities.)

    And "seconds since midnight" where taken despite the Julian Dates
    have a day start at high noon (12:00)? [*]

    Janis

    [*] I recall that e.g. SunOS also had that wrong and assumed start at
    midnight. Folks generally don't seem to be aware of that difference.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Janis Papanagnou on Mon Apr 28 23:34:53 2025
    On 4/28/25 20:10, Janis Papanagnou wrote:
    [ Just noticed this post while catching up in my backlog, so I'm not
    sure my questions/comments have already been addressed elsewhere. ]

    On 16.04.2025 22:04, Scott Lurndal wrote:
    [...]

    Back in the mainframe days, it was common to use julian dates
    as they were both concise (5 BCD digits/20 bits) and sortable.

    YYDDD

    If time was neeeded, it was seconds since midnight in a reference
    timezone.

    I don't quite understand the rationale behind all that said above.

    "YYDDD" was used without century information? How is that useful?
    (I assume it's just the popular laziness that later lead to all the
    Y2k chaos activities.)

    And "seconds since midnight" where taken despite the Julian Dates
    have a day start at high noon (12:00)? [*]

    Strictly speaking, "Julian Day" is the number of days since Jan 01 4713
    BCE at Noon (a date that was chosen because it simplifies conversion
    between several different ancient calendar systems. It starts at Noon
    because it was devised for use by astronomers, who are generally awake
    at midnight and asleep at Noon (especially in ancient times).

    Informally speaking, "Julian Day" is commonly used to refer to any
    system for designating dates that include a "day of year" component, as
    does the above example. Most of these start at midnight, not Noon.

    There's no use being a purist about this (that would be my preference
    too) - the informal meaning is quite common, probably more common than
    the "correct" one.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From candycanearter07@21:1/5 to Janis Papanagnou on Tue Apr 29 05:10:05 2025
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote at 00:10 this Tuesday (GMT):
    [ Just noticed this post while catching up in my backlog, so I'm not
    sure my questions/comments have already been addressed elsewhere. ]

    On 16.04.2025 22:04, Scott Lurndal wrote:
    [...]

    Back in the mainframe days, it was common to use julian dates
    as they were both concise (5 BCD digits/20 bits) and sortable.

    YYDDD

    If time was neeeded, it was seconds since midnight in a reference
    timezone.

    I don't quite understand the rationale behind all that said above.

    "YYDDD" was used without century information? How is that useful?
    (I assume it's just the popular laziness that later lead to all the
    Y2k chaos activities.)
    [snip]


    I believe the current rule for software is to consider "39" the cutoff,
    ie 39 is considered 2039, and 40 is considered 1940. I agree though,
    removing the century is a bad idea for anything that is supposed to be
    kept for a length of time.
    --
    user <candycane> is generated from /dev/urandom

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to All on Tue Apr 29 01:24:20 2025
    On 4/29/25 01:10, candycanearter07 wrote:
    ...
    I believe the current rule for software is to consider "39" the cutoff,
    ie 39 is considered 2039, and 40 is considered 1940. I agree though,
    removing the century is a bad idea for anything that is supposed to be
    kept for a length of time.

    I sincerely doubt that there is any unique current rule for interpreting two-digit year numbers - just a wide variety of different rules used by different people for different purposes. That's part of the reason why
    it's a bad idea to rely upon such rules.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Keith Thompson on Tue Apr 29 08:37:31 2025
    On 29.04.2025 04:20, Keith Thompson wrote:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    [...]

    [*] I recall that e.g. SunOS also had that wrong and assumed start at
    midnight. Folks generally don't seem to be aware of that difference.

    I don't recall SunOS using any kind of Julian days/dates for anything
    at the system level, though some programs might. [...]

    I only faintly recall that it was either some screen lock displaying (also/optionally?) Julian Dates or a screen clock with that property.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to James Kuyper on Tue Apr 29 08:44:39 2025
    On 29.04.2025 05:34, James Kuyper wrote:
    On 4/28/25 20:10, Janis Papanagnou wrote:
    [...]

    And "seconds since midnight" where taken despite the Julian Dates
    have a day start at high noon (12:00)? [*]

    Strictly speaking, "Julian Day" is the number of days since Jan 01 4713
    BCE at Noon (a date that was chosen because it simplifies conversion
    between several different ancient calendar systems. It starts at Noon
    because it was devised for use by astronomers, who are generally awake
    at midnight and asleep at Noon (especially in ancient times).

    Informally speaking, "Julian Day" is commonly used to refer to any
    system for designating dates that include a "day of year" component, as
    does the above example. Most of these start at midnight, not Noon.

    There's no use being a purist about this (that would be my preference
    too) - the informal meaning is quite common, probably more common than
    the "correct" one.

    In my language domain we have terms like "Modified Julian Date"
    (MJD) that relate to the Julian Date according to the formula
    MJD = JD - 2'400'000.5
    But as Keith mentioned the terms seem not be used consistently.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Keith Thompson on Tue Apr 29 13:14:55 2025
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    [ Just noticed this post while catching up in my backlog, so I'm not
    sure my questions/comments have already been addressed elsewhere. ]

    On 16.04.2025 22:04, Scott Lurndal wrote:
    [...]

    Back in the mainframe days, it was common to use julian dates
    as they were both concise (5 BCD digits/20 bits) and sortable.

    YYDDD

    If time was neeeded, it was seconds since midnight in a reference
    timezone.

    I don't quite understand the rationale behind all that said above.

    "YYDDD" was used without century information? How is that useful?
    (I assume it's just the popular laziness that later lead to all the
    Y2k chaos activities.)

    Yes, it was felt that saving storage (perhaps in the form of columns
    on punch cards) was more important than supporting dates after 1999.

    Especially important in the 60s and 70s.

    By the 1985, we were already planning for Y2K at Burroughs. The
    solution settled upon was that two-digit years less than 60 referred
    to the 21st century, and the rest referred to the 20th.


    One relic of this is the tm_year member of struct tm in <time.h>,
    which holds number of years since 1900. It was (I'm fairly sure)
    originally just a 2-digit year number.

    And "seconds since midnight" where taken despite the Julian Dates
    have a day start at high noon (12:00)? [*]

    The Julian day number used by astronomers does start at noon,
    specifically at noon, Universal Time, Monday, January 1, 4713 BC
    in the proleptic Julian calendar. As I write this, the current
    Julian date is 2460794.591939746.

    Outside of astronomy, the word Julian is (mis)used for just about
    anything that counts days rather than months and days. A date
    expressed in the form YYDDD (or YYYYDDD, or YYYYDDD) almost certainly
    refers to a calendar day, starting and ending at midnight in some
    time zone. See also the tm_yday member of struct tm, which counts
    days since January 1 of the specified year.

    Yes, that was the case for Burroughs. The MCP had a 'midnight'
    rollover function that updated the current date and reset the
    time to 0 (all stored in BCD).

    The unix style 'seconds since epoch' was much less fraught.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to BGB on Tue Apr 29 19:25:00 2025
    On 29/04/2025 19:02, BGB wrote:
    On 4/29/2025 12:24 AM, James Kuyper wrote:
    On 4/29/25 01:10, candycanearter07 wrote:
    ...
    I believe the current rule for software is to consider "39"
    the cutoff,
    ie 39 is considered 2039, and 40 is considered 1940. I agree
    though,
    removing the century is a bad idea for anything that is
    supposed to be
    kept for a length of time.

    I sincerely doubt that there is any unique current rule for
    interpreting
    two-digit year numbers - just a wide variety of different rules
    used by
    different people for different purposes. That's part of the
    reason why
    it's a bad idea to rely upon such rules.

    Could always argue for a compromise, say, 1 signed byte year.
      Say: 1872 to 2127, if origin is 2000.
    Could also be 2 digits if expressed in hexadecimal.

    Or, maybe 1612 BC to 5612 AD if the year were 2 digits in Base 85.
      Or, 48 BC to 4048 AD with Base 64.

    Or we could argue for any of a thousand other ideas for rules...
    and more besides. As a very wise man recently said: "That's part
    of the reason why it's a bad idea to rely upon such rules."

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to BGB on Tue Apr 29 19:00:53 2025
    BGB <cr88192@gmail.com> writes:
    On 4/29/2025 12:24 AM, James Kuyper wrote:
    On 4/29/25 01:10, candycanearter07 wrote:
    ...
    I believe the current rule for software is to consider "39" the cutoff,
    ie 39 is considered 2039, and 40 is considered 1940. I agree though,
    removing the century is a bad idea for anything that is supposed to be
    kept for a length of time.

    I sincerely doubt that there is any unique current rule for interpreting
    two-digit year numbers - just a wide variety of different rules used by
    different people for different purposes. That's part of the reason why
    it's a bad idea to rely upon such rules.

    Could always argue for a compromise, say, 1 signed byte year.
    Say: 1872 to 2127, if origin is 2000.
    Could also be 2 digits if expressed in hexadecimal.

    All of which would be non-starters. Undigits (a-f)
    in a BCD value would cause traps in many cases, breaking
    existing applications.

    Not to mention that with BCD, hardware could create a
    printable value by simple prefixing each digit with the
    correct zone digit (0xF for EBCDIC, 0x3 for ASCII). That
    breaks when the BCD value has undigits.

    The Burroughs medium systems "MVN" and "MVA" instructions
    would automatically add/remove the zone digit based on
    each operands type (and fill or truncate when source and
    destination lengths differ).

    Then there were tricks like:

    01 MASTER-TBL. 104 CARD 1 17856
    05 MAROW OCCURS 126 TIMES. 105 CARD 1 17856
    10 MACOL PIC X OCCURS 126 TIMES. 106 CARD 1 17856


    1200-INITIALIZE-GALAXY. 460 CARD 1 61272
    MOVE SPACES TO MASTER-TBL. 461 CARD 1 61272
    01 061272 MVA 10B304 404040 217856 CODE
    01 061290 MVW 127937 217856 217860 CODE
    ^ ^ ^
    Insn Operand1 Operand2

    Which moves a three byte EBCIDC (404040) constant in the first operand field to the first word
    of the MASTER-TBL at address 17856 padding with with a trailing blank. The next instruction (MVW - move 16-bit words) smears those four blank characters across the entire
    MASTER_TBL, basically initalizing the entire table with blanks using an overlapping
    move (Length of the move is 7937 words to fill the entire table).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Kaz Kylheku on Wed Apr 30 08:12:40 2025
    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    On 2025-04-07, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    antispam@fricas.org (Waldek Hebisch) writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    [...]

    Not always practical. A good example is the type size_t. If a
    function takes an argument of type size_t, then the symbol size_t
    should be defined, no matter which header the function is being
    declared in.

    Why? One can use a type without a name for such type.

    Convenience and existing practice. Sure, an implementation of
    <string.h> could provide a declaration of memcpy() without making
    size_t visible, but what would be the point?

    Ther eis a point to such a discipline; you get ultra squeaky clean
    modules whose header files define only their contribution to
    the program, and do not transitively reveal any of the identifiers
    from their dependencies.

    That's a circular argument. If a header is designed so it doesn't
    define type names like size_t, then #include'ing it won't define
    those names. It is equally true that if a header is designed so
    it does define such type names then #include'ing it will define
    those names.

    Incidentally, calling it "squeaky clean" is meaningless; just
    more circular reasoning.

    In large programs, this clean practice can can help prevent
    clashes.

    That doesn't apply to headers defined by the ISO C standard,
    which is the topic under discussion.

    [...]

    Using memcpy as an example, it could be declared as

    void *memcpy(void * restrict d, const void * restrict s,
    __size_t size);

    size_t is not revealed, but a private type __size_t.

    To get __size_t, some private header is included <sys/priv_types.h>
    or whatever.

    The <stddef.h> header just includes that one and typedefs __size_t
    size_t (if it were to work that way).

    A system vendor which provides many API's and has the privilege of
    being able to use the __* space could do things like this.

    An implicit logical fallacy. Just because something /can/ be done
    doesn't mean it /should/ be done.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Waldek Hebisch on Wed Apr 30 08:37:54 2025
    antispam@fricas.org (Waldek Hebisch) writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    [some symbols are defined in more than one header]

    (In my opinion, things would be better if headers were not allowed
    to behave as if they include other headers, or provide identifiers
    also given in other heards. Not in ISO C, and not in POSIX.
    Every identifier should be declared in exactly one home header,
    and no other header should provide that definition. [...])

    Not always practical. A good example is the type size_t. If a
    function takes an argument of type size_t, then the symbol size_t
    should be defined, no matter which header the function is being
    declared in.

    Why?

    Because, in many cases or most cases, when a particular interface is
    used, there will be a need to declare variables of a type used in the
    interface (either a parameter type or the return type), or to use
    such types in other ways (casting, for example). Not defining those
    type names makes more work for the client.

    One can use a type without a name for such type.

    What you mean is it's possible to produce values of such types
    without needing to use the name of the type. In some cases that's
    true, but often there are other needs that are not addressed by
    that possibility, as mentioned in the last paragraph. Furthermore
    it doesn't cover cases of derived types, such as size_t *.

    Similarly for NULL for any function that has defined
    behavior on some cases of arguments that include NULL.

    Why? There are many ways to produce null pointers.

    The macro NULL is used for purposes of documentation. Of course a
    simple 0 (perhaps casted to an appropriate type) could be used
    instead, but that defeats the purpose of using NULL.

    And fact that
    a function had defined behavior for null pointers does not mean
    that users will need null pointers.

    No guarantee, but there is a reasonable likelihood. It's more
    convenient for the client if such things are always provided.

    No doubt
    there are other compelling examples.

    Do not look compelling at all.

    Clearly the people who wrote the ISO C standard feel differently.
    I agree with their judgment. And I haven't seen any argument
    that a different judgment should prevail, not counting the silly
    circular argument offered by another poster.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Waldek Hebisch on Wed Apr 30 09:45:51 2025
    antispam@fricas.org (Waldek Hebisch) writes:

    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    antispam@fricas.org (Waldek Hebisch) writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    [...]

    Not always practical. A good example is the type size_t. If a
    function takes an argument of type size_t, then the symbol size_t
    should be defined, no matter which header the function is being
    declared in.

    Why? One can use a type without a name for such type.

    Convenience and existing practice. Sure, an implementation of
    <string.h> could provide a declaration of memcpy() without making
    size_t visible, but what would be the point?

    Cleanliness of definitions? Consistency?

    Convenience of clients of the interface: less work and very
    little downside.

    Existing practice: module systems have been around since the mid
    1970s. Typically a module interface also makes available names of
    all types used by functions in the interface.

    Fragment that you
    replaced by [...] contained a proposal:

    Every identifier should be declared in exactly one home header,
    and no other header should provide that definition.

    That would be pretty clean and consistent rule: if you need some
    standard symbol, then you should include corresponding header.

    That is a simple rule, but not the only simple rule. The C standard
    library consistently follows the simple rule that headers define
    names for all the types used by the interface, so just #include'ing
    the header means all types used by those interface functions are
    available. As far as clients are concerned, that rule is simpler.

    Tim claimed that this in not practical. Clearly C standard
    changed previous practice about headers,

    I believe that's not true, but certainly it is not /clearly/ true.
    A lot of time passed between 1978, when K&R was published, and 1989,
    when the first C standard was ratified. No doubt the C standard
    unified different practices among many existing C implementations,
    but it is highly likely that some of them anticipated the rules that
    would be ratified in the C standard.

    so existing practice is _not_ a practical problem with adapting
    such proposal.

    Common practice for module definitions, across many languages, is to
    make available names for the types used by interfaces that are
    supplied by the module.

    With current standard and practice one frequently needs symbols
    from several headers,

    Yes but there is a key difference. Different headers correspond to
    major areas of interface. It is natural, for example to expect the
    functions of <stdio.h> and <string.h> to be in separate headers.
    That expectation does not extend to names like size_t, which plays a
    support role rather than a primary role.

    so "convenience" is also not a practival problem with such
    proposal.

    Nonsense. Having to do a separate #include for size_t would be a
    pain in the ass.

    People not interested in clean name space can
    define private "all.h" which includes all standard C headers
    and possibly other things that they need, so for them overhead
    is close to zero.

    This point of view strikes me as the tail wagging the dog. The ISO
    C standard made a decision to make a few very commonly used names
    available from several different headers. I'm not aware of any
    practical problems that have been caused by that decision, and I
    don't remember hearing anyone object to it until just very recently
    by just a few people. The idea that any name defined in the
    standard library should be available in only one header gives the
    impression of an intellectual suggestion untethered to any practical experience.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Tim Rentsch on Wed Apr 30 17:41:21 2025
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    antispam@fricas.org (Waldek Hebisch) writes:


    I believe that's not true, but certainly it is not /clearly/ true.
    A lot of time passed between 1978, when K&R was published, and 1989,
    when the first C standard was ratified. No doubt the C standard
    unified different practices among many existing C implementations,
    but it is highly likely that some of them anticipated the rules that
    would be ratified in the C standard.

    Looking at SVID 3rd edition (1989), size_t did not yet exist, so in
    that particular case, there was no need to implicitly define
    it in any header file.

    For interfaces that require custom typedefs (for example, stat(2)),
    the SVID requires the programmer include <sys/types.h> before including <sys/stat.h>.

    When size_t was added there were existing interfaces where the
    argument was changed to require size_t/ssize_t. These interfaces
    did not, at the time, require the programmer to include <sys/types.h> or <stddef.h>
    in order to use the interface, for example in the SVID memory(BA_LIB)
    interface description, the programmer had been instructed that only
    <string.h> was required for the str* functions, and <memory.h> was
    required for the mem* functions - but the SVID noted at that time
    that the latter was deprecated - the pending ANSI C standard was
    to require only <string.h>.

    So, when the arguments of memcpy/strcpy were changed from int to
    size_t, they couldn't go back and require existing code to include
    e.g. <stddef.h> to get size_t; POSIX chose to note in the
    interface description that additional typedefs may be visible
    when <string.h> is included.

    "The <string.h> header shall define NULL and size_t as described in <stddef.h>."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Richard Heathfield on Wed Apr 30 23:57:56 2025
    On Mon, 28 Apr 2025 07:52:10 +0100, Richard Heathfield wrote:

    The fact that ncal knows about the 11-day shift ...

    Note the calendar listing I posted had a 10-day shift.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to James Kuyper on Wed Apr 30 23:58:35 2025
    On Mon, 28 Apr 2025 23:34:53 -0400, James Kuyper wrote:

    Strictly speaking, "Julian Day" is the number of days since Jan 01 4713
    BCE at Noon ...

    In which time zone?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Muttley on Thu May 1 00:01:28 2025
    On Wed, 9 Apr 2025 09:01:34 -0000 (UTC), Muttley wrote:

    On Tue, 8 Apr 2025 20:53:45 +0300 Michael S <already5chosen@yahoo.com> wibbled:

    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    Any chance of using utf8 rather than whatever the hell encoding this is.

    I use Pan, which had no trouble making sense of that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Lawrence D'Oliveiro on Thu May 1 06:17:22 2025
    On 01/05/2025 00:57, Lawrence D'Oliveiro wrote:
    On Mon, 28 Apr 2025 07:52:10 +0100, Richard Heathfield wrote:

    The fact that ncal knows about the 11-day shift ...

    Note the calendar listing I posted had a 10-day shift.

    So it did. When you're right, you're right.

    --
    Richard Heathfield
    Email: rjh at cpax dot org dot uk
    "Usenet is a strange place" - dmr 29 July 1999
    Sig line 4 vacant - apply within

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Michael S on Mon May 5 16:40:15 2025
    Michael S <already5chosen@yahoo.com> writes:

    On Mon, 21 Apr 2025 14:28:30 -0700
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    David Brown <david.brown@hesbynett.no> writes:
    [...]

    I don't know enough about Thorium 229 nuclear resonances to be able
    to predict one way or the other. Do you have a good reason or
    reference for your thoughts here?

    Can you PLEASE take this somewhere else? (Or drop it, I don't care.)

    Don't read anything into the fact that I replied to one particular
    participant in the thread.

    There are two types of usenet groups:
    - groups that suffer from significat amount of OT discussions
    - dead

    I'm not sure I agree with that dichotomy, but even if I did,
    there's a difference between an amount of OT traffic that is
    merely annoying and the overwhelming floods of OT traffic that
    take place far too often in comp.lang.c. Every reduction
    helps.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Michael S on Mon May 5 16:25:57 2025
    Michael S <already5chosen@yahoo.com> writes:

    On Mon, 14 Apr 2025 01:59:24 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    Michael S <already5chosen@yahoo.com> writes:

    On Wed, 09 Apr 2025 13:14:55 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    [may trailing commas in argument lists be accepted, or
    must they be rejected?]

    It is required in the sense that it is a syntax error,
    and syntax errors require a diagnostic.

    Trailing commas in argument lists and/or parameter lists
    could be accepted as an extension, even without giving a
    diagnostic as I read the C standard, but implementations
    are certainly within their rights to reject them.

    I have no doubts that implementations have full rights to reject
    them. The question was about possibility to accept them and
    especially about possibility to accept without diagnostics.
    So, it seems, there is no consensus about it among few posters
    that read the relevant part of the standard.

    I don't think anyone should care about that. If there were any
    significant demand for allowing such trailing commas then someone
    would implement it, and people would use it even if in some
    technical sense it meant that an implementation supporting it
    would be nonconforming.

    Personally, I'd use this feature if it would be standard.

    Me too.

    But if it would be non-standard feature supported by both gcc and
    clang I would hesitate.

    Me too.

    Besides, the opinions of people posting
    in comp.lang.c carry zero weight; the only opinions that matter
    are those of peole on the ISO C committee, and the major compiler
    writers, and none of those people bother posting here.

    My impression was that Philipp Klaus Krause that posts here, if
    infrequently, is a member of WG14.

    Do you know if he is a member, or is he just an interested
    participant?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Tim Rentsch on Tue May 6 11:26:39 2025
    On Mon, 05 May 2025 16:25:57 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    Michael S <already5chosen@yahoo.com> writes:


    My impression was that Philipp Klaus Krause that posts here, if infrequently, is a member of WG14.

    Do you know if he is a member, or is he just an interested
    participant?


    He appears in the picture named "WG14 members attending the Strasbourg
    meeting in-person for the finalization of C23". To me that sounds as
    sufficient proof.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Michael S on Tue May 6 06:56:43 2025
    Michael S <already5chosen@yahoo.com> writes:

    On Mon, 14 Apr 2025 01:24:49 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    about where they may or may not be used. Do you really have a
    problem avoiding identifiers defined in this or that library
    header, either for all headers or just those headers required for
    freestanding implementations?

    I don't know. In order to know I'd have to include all
    standard headers into all of my C files

    Let me ask the question differently. Have you ever run into an
    actual problem due to inadvertent collision with a reserved
    identifier?

    But I would guess that for headers required for freestanding
    implementations I would have no problems.

    There are a few freestanding-required headers that I use often
    enough that for practical purposes they can be considered as
    always having been #include'd. Those headers are <limits.h>,
    <stdarg.h>, and <stddef.h>.

    For headers more generally, <stdio.h>, <stdlib.h>, and <string.h>
    are the most prevalent; there are cases where these headers have
    not been #include'd, but those cases are the exception rather than
    the rule. All other headers I #include only on an as-needed basis,
    although the threshold is higher for some than for others. A good
    example is <errno.h>. I try to limit those .c files where <errno.h>
    has been #include'd, because of the rule about preprocessor symbols
    starting with E (which I treat as ruling out any macro starting with
    the letter E, even though the rule in the C standard might be
    somewhat different). For comparison, I'm okay with the rule that
    function names that start str[a-z], mem[a-z], or wcs[a-s] should be
    avoided everywhere (because of <stdlib.h> and <string.h>), and
    similarly for function names that start either is[a-z] or to[a-z]
    (because of <ctype.h>). A good resource for finding symbols to
    avoid is the section on Future library directions, which offers a
    nicely compact summary of the most significant reserved names.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Michael S on Tue May 6 15:06:50 2025
    Michael S <already5chosen@yahoo.com> writes:

    On Sun, 27 Apr 2025 12:05:16 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    Michael S <already5chosen@yahoo.com> writes:

    On Wed, 02 Apr 2025 16:59:59 +1100
    Alexis <flexibeast@gmail.com> wrote:

    Thought people here might be interested in this image on Jens
    Gustedt's blog, which translates section 6.2.5, "Types", of the C23
    standard into a graph of inclusions:

    https://gustedt.wordpress.com/2025/03/29/a-diagram-of-c23-basic-types/ >>>
    That's a little disappointing.
    IMHO, C23 should have added optional types _Binary32, _Binary64,
    _Binary128 and _Binary256 that designate their IEEE-754 namesakes.
    Plus, a mandatory requirement that if compiler supports any of
    IEEE-754 binary types then they have to be accessible by
    above-mentioned names.

    I see where you're coming from,

    I suppose, you know it because you followed my failed attempt to improve speed and cross-platform consistency of gcc IEEE binary128 arithmetic.

    Actually I didn't know about that. To me your posting upthread
    is enough to see where you're coming from (or at least I think
    it is).

    Granted, in this case absence of common name for the type was much
    smaller obstacle than general indifference of gcc maintainers.
    So, yes, on the "producer" side the problem of absence of common name
    was annoying but could be regarded as minor.

    Apart from being a "producer", quite often I am on the other side,
    wearing a hat of consumer of extended precision types. When in this
    role, I feel that the relative weight of inconsistent type names is
    rather significant. I'd guess that it is even more significant for
    people whose work, unlike mine, is routinely multi-platform. I would
    not be surprised if for many of them it ends up as main reason to
    refrain completely from use IEEE binary128 in their software; even when
    it causes complications to their work and when the type is
    readily available, under different names, on all platforms they care
    about.

    I acknowledge that people feel that there is a problem in need
    of being addressed. The question is not whether a problem
    exists but what exactly is the problem and how should it be
    addressed? For example, rather than tie a proposal to some
    future release of the ISO C standard, maybe the question should
    be addressed by Posix. It's hard to have a fruitful discussion
    about what the answer should be before people understand and
    agree what the problem is that needs to be addressed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Scott Lurndal on Thu May 8 05:59:29 2025
    scott@slp53.sl.home (Scott Lurndal) writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    antispam@fricas.org (Waldek Hebisch) writes:


    I believe that's not true, but certainly it is not /clearly/ true.
    A lot of time passed between 1978, when K&R was published, and
    1989, when the first C standard was ratified. No doubt the C
    standard unified different practices among many existing C
    implementations, but it is highly likely that some of them
    anticipated the rules that would be ratified in the C standard.

    Looking at SVID 3rd edition (1989), size_t did not yet exist, so in
    that particular case, there was no need to implicitly define it in
    any header file.

    For interfaces that require custom typedefs (for example, stat(2)),
    the SVID requires the programmer include <sys/types.h> before
    including <sys/stat.h>.

    When size_t was added there were existing interfaces where the
    argument was changed to require size_t/ssize_t. These interfaces
    did not, at the time, require the programmer to include
    <sys/types.h> or <stddef.h> in order to use the interface, for
    example in the SVID memory(BA_LIB) interface description, the
    programmer had been instructed that only <string.h> was required
    for the str* functions, and <memory.h> was required for the mem*
    functions - but the SVID noted at that time that the latter was
    deprecated - the pending ANSI C standard was to require only
    <string.h>.

    So, when the arguments of memcpy/strcpy were changed from int to
    size_t, they couldn't go back and require existing code to include
    e.g. <stddef.h> to get size_t; POSIX chose to note in the
    interface description that additional typedefs may be visible
    when <string.h> is included.

    "The <string.h> header shall define NULL and size_t as described
    in <stddef.h>."

    Thank you for this report. I wasn't paying attention to any
    standardization efforts in that time frame; it's good to have
    some actual data to look at.

    After digging into the history, I have the impression that SVID
    was hoping to be a leader in defining standard interfaces (which
    I think included C proper but was not limited to that, which
    makes sense as there was also Unix to consider). So it isn't
    surprising that size_t did not appear in SVID until the onoing
    ANSI effort completed, and the ANSI C standard was ratified. No
    doubt there were other organizations closer to the then-current
    C standardization effort (which had been going on for at least
    five years IIANM), and it seems likely that in some cases there
    were environments in use that anticipated the looming ANSI C
    standard.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Michael S on Thu May 8 06:08:03 2025
    Michael S <already5chosen@yahoo.com> writes:

    On Mon, 05 May 2025 16:25:57 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    Michael S <already5chosen@yahoo.com> writes:

    My impression was that Philipp Klaus Krause that posts here, if
    infrequently, is a member of WG14.

    Do you know if he is a member, or is he just an interested
    participant?

    He appears in the picture named "WG14 members attending the Strasbourg meeting in-person for the finalization of C23". To me that sounds as sufficient proof.

    Thank you for the additional information. I want to be clear
    that it was not my intention to express doubt; I was just
    looking for clarification.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Tim Rentsch on Thu May 8 13:42:40 2025
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    scott@slp53.sl.home (Scott Lurndal) writes:


    After digging into the history, I have the impression that SVID
    was hoping to be a leader in defining standard interfaces (which

    SVID was AT&T's attempt to standardize unix interfaces. The last
    edition (third) was released in 1989, but earlier versions date
    to 1983.

    As to who, exactly, first proposed size_t, that I don't recall.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Waldek Hebisch@21:1/5 to Tim Rentsch on Thu May 8 14:09:43 2025
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
    Michael S <already5chosen@yahoo.com> writes:

    On Mon, 14 Apr 2025 01:24:49 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    about where they may or may not be used. Do you really have a
    problem avoiding identifiers defined in this or that library
    header, either for all headers or just those headers required for
    freestanding implementations?

    I don't know. In order to know I'd have to include all
    standard headers into all of my C files

    Let me ask the question differently. Have you ever run into an
    actual problem due to inadvertent collision with a reserved
    identifier?

    Not in my own code. But I remember an old piece of code whose
    author apparently thought that 'inline' is a perfect name for
    input line. Few days ago I had trouble compiling with gcc-15
    code which declares its own 'bool' type. The code is supposed to
    compile using a wide range of compilers, so I am still looking
    for "best" solution.

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Waldek Hebisch on Thu May 8 16:52:47 2025
    On 08/05/2025 16:09, Waldek Hebisch wrote:
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
    Michael S <already5chosen@yahoo.com> writes:

    On Mon, 14 Apr 2025 01:24:49 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    about where they may or may not be used. Do you really have a
    problem avoiding identifiers defined in this or that library
    header, either for all headers or just those headers required for
    freestanding implementations?

    I don't know. In order to know I'd have to include all
    standard headers into all of my C files

    Let me ask the question differently. Have you ever run into an
    actual problem due to inadvertent collision with a reserved
    identifier?

    Not in my own code. But I remember an old piece of code whose
    author apparently thought that 'inline' is a perfect name for
    input line. Few days ago I had trouble compiling with gcc-15
    code which declares its own 'bool' type. The code is supposed to
    compile using a wide range of compilers, so I am still looking
    for "best" solution.


    gcc changed the default standard to "gnu23" in gcc15, from "gnu17" in
    earlier versions. Their policy is that unless you specify the standard explicitly, you get the latest C standard that is well-supported by gcc,
    along with the common gcc extensions. (New ISO C standards supersede
    older ones - thus "C" means "C23" at the moment.)

    And in C23, "bool", "true" and "false" are now keywords. The boolean
    type was renamed "bool" with "_Bool" being an alias for compatibility.
    C23 has more backwards incompatible changes than usual for C standards
    since C99. (Personally, I am happy to see such changes - people have
    had a generation to get used to C booleans - but I fully understand that
    does not apply to everyone or all code.)

    The "best" solution, IMHO, is that you should never use a C compiler for serious work without specifying the standard you are using. (And if the
    C compiler doesn't let you choose the standard, consider whether it is
    actually a suitable tool for serious work.) If you decide that you want
    C23, with or without gcc extensions, you will need to fix that ancient
    code to remove or rename its home-made "bool" type. If you want to keep
    the code unchanged, pick an appropriate older C standard. (You will
    also want to do that if you want to be able to compile the code with
    older gcc versions or other compilers that don't yet support C23.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Keith Thompson on Thu May 8 08:37:59 2025
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    Michael S <already5chosen@yahoo.com> writes:

    On Mon, 14 Apr 2025 01:24:49 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    about where they may or may not be used. Do you really have a
    problem avoiding identifiers defined in this or that library
    header, either for all headers or just those headers required for
    freestanding implementations?

    I don't know. In order to know I'd have to include all
    standard headers into all of my C files

    Let me ask the question differently. Have you ever run into an
    actual problem due to inadvertent collision with a reserved
    identifier?

    I'm not Michael, but I was once mildly inconvienced because I
    defined a logging function called log(). The solution was trivial:
    I changed the name.

    Yes, I expect I have run into similar situations. What I was
    wondering about were problems where either the existence of
    the problem or what to do to fix it needed more than a minimal
    effort.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Scott Lurndal on Thu May 8 08:33:15 2025
    scott@slp53.sl.home (Scott Lurndal) writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    scott@slp53.sl.home (Scott Lurndal) writes:
    [...]
    After digging into the history, I have the impression that SVID
    was hoping to be a leader in defining standard interfaces (which

    SVID was AT&T's attempt to standardize unix interfaces. The last
    edition (third) was released in 1989, but earlier versions date
    to 1983.

    As to who, exactly, first proposed size_t, that I don't recall.

    I've looked but haven't found any information on that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Tim Rentsch on Thu May 8 15:48:07 2025
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    Michael S <already5chosen@yahoo.com> writes:

    On Mon, 14 Apr 2025 01:24:49 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    about where they may or may not be used. Do you really have a
    problem avoiding identifiers defined in this or that library
    header, either for all headers or just those headers required for
    freestanding implementations?

    I don't know. In order to know I'd have to include all
    standard headers into all of my C files

    Let me ask the question differently. Have you ever run into an
    actual problem due to inadvertent collision with a reserved
    identifier?

    I'm not Michael, but I was once mildly inconvienced because I
    defined a logging function called log(). The solution was trivial:
    I changed the name.

    Yes, I expect I have run into similar situations. What I was
    wondering about were problems where either the existence of
    the problem or what to do to fix it needed more than a minimal
    effort.

    I recall running into issues using variables named 'index'
    when porting code to SVR4 when the BSD compatibility layer
    was present.

    https://man.freebsd.org/cgi/man.cgi?query=index&sektion=3

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Waldek Hebisch on Thu May 8 08:49:58 2025
    antispam@fricas.org (Waldek Hebisch) writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    Michael S <already5chosen@yahoo.com> writes:

    On Mon, 14 Apr 2025 01:24:49 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    about where they may or may not be used. Do you really have a
    problem avoiding identifiers defined in this or that library
    header, either for all headers or just those headers required for
    freestanding implementations?

    I don't know. In order to know I'd have to include all
    standard headers into all of my C files

    Let me ask the question differently. Have you ever run into an
    actual problem due to inadvertent collision with a reserved
    identifier?

    Not in my own code. But I remember an old piece of code whose
    author apparently thought that 'inline' is a perfect name for
    input line.

    Yeah. That falls into a different category, because 'inline' is a
    keyword rather than being defined in a standard header. In any case
    the problem is essentially impossible to miss, and straightforward
    to fix.

    Few days ago I had trouble compiling with gcc-15
    code which declares its own 'bool' type. The code is supposed to
    compile using a wide range of compilers, so I am still looking
    for "best" solution.

    When I had to deal with a similar problem in the past, my
    approach was something along these lines (obviously more
    cases can be added if needed to deal with unusual compilers
    or compilation options):


    #if defined bool
    #undef bool
    #endif

    #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
    typedef unsigned char bool;

    #elif __STDC_VERSION__ < 201112L
    typedef _Bool bool;

    #elif __STDC_VERSION__ < 201710L
    typedef _Bool bool;

    #elif __STDC_VERSION__ < 202300L
    typedef _Bool bool;

    #else
    /* 'bool' is keyword in C23+ ... */

    #endif

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Scott Lurndal on Thu May 8 16:32:10 2025
    On 2025-05-08, Scott Lurndal <scott@slp53.sl.home> wrote:
    I recall running into issues using variables named 'index'
    when porting code to SVR4 when the BSD compatibility layer
    was present.

    I've also run into issues with clashes with BSD-specific
    functions on those systems.

    It's because the BSD people refuse to understand how feature selection
    macros are supposed to work.

    In BSD toolchains, if you don't specify any -D_WHATEVER=BLAH feature
    selection macro, then all identifiers are visible.

    When when features are specified, they *restrict* visibility.

    When you specify -D_FOO and -D_BAR, you get the *intersection*
    of FOO and BAR.

    That includes compiler dialect selection options. Under BSDs,
    if you specify, say, "-ansi" on your command line, you are
    not only getting a certain dialect from the compiler, but
    the BSD header files like <stdio.h> will hide POSIX functions
    like fdopen, even if you have a POSIX macro like -D_POSIX_SOURCE.
    The intersection of ANSI and POSIX does not contain fdopen.

    So what ends up happening on BSDs is that you end up revealing
    more identifiers than you need, which exposes clashes.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Scott Lurndal on Thu May 8 22:53:42 2025
    scott@slp53.sl.home (Scott Lurndal) writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    Michael S <already5chosen@yahoo.com> writes:

    On Mon, 14 Apr 2025 01:24:49 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    about where they may or may not be used. Do you really have a
    problem avoiding identifiers defined in this or that library
    header, either for all headers or just those headers required
    for freestanding implementations?

    I don't know. In order to know I'd have to include all
    standard headers into all of my C files

    Let me ask the question differently. Have you ever run into an
    actual problem due to inadvertent collision with a reserved
    identifier?

    I'm not Michael, but I was once mildly inconvienced because I
    defined a logging function called log(). The solution was
    trivial: I changed the name.

    Yes, I expect I have run into similar situations. What I was
    wondering about were problems where either the existence of the
    problem or what to do to fix it needed more than a minimal
    effort.

    I recall running into issues using variables named 'index'
    when porting code to SVR4 when the BSD compatibility layer
    was present.

    https://man.freebsd.org/cgi/man.cgi?query=index&sektion=3

    I understand how that might be annoying. Did you have
    any trouble either discovering what the problem was or
    fixing it once you did, or both? I presume there was
    no difficulty in knowing that there /was/ a problem; is
    that not the case?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)