• Re: encapsulating directory operations

    From Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Tue May 20 07:27:10 2025
    On Tue, 20 May 2025 16:06:19 +1000, Paul Edwards wrote:

    And in essence, when you read from a directory, the only thing you get
    is the filename.

    You want at least the type of entry as well, surely.

    <https://manpages.debian.org/readdir(3)>

    If it is actually a subdirectory, then that is
    indicated with a "/" at the end of the filename.

    What if it’s a symlink to a directory?

    Now C90 doesn't have folder/directory operations (such as opendir()) for
    a reason.

    Surely OSes that don’t support hierarchical directories are only fit for
    the museum nowadays.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Keith Thompson on Tue May 20 10:33:29 2025
    On 20/05/2025 10:18, Keith Thompson wrote:
    C90 will never be extended.

    And for that reason it will always be valuable. Stability has a
    value all its own.

    --
    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 David Brown@21:1/5 to Richard Heathfield on Tue May 20 13:42:52 2025
    On 20/05/2025 11:33, Richard Heathfield wrote:
    On 20/05/2025 10:18, Keith Thompson wrote:
    C90 will never be extended.

    And for that reason it will always be valuable. Stability has a value
    all its own.


    Sure.

    Similarly, C99, C11 and even C17 are stable and are valuable because of
    that stability. It's good that developers have, to a fair extent at
    least, an option to pick their stable point for their projects.

    It is actually not the fact that C has had stability in its standards
    that is valuable. Python 1.0 has not changed - it is stable. What
    makes C different as a development language is two things - modern tools continue to support old standards, and new standards are, to a very
    large extent, compatible with the old standards.

    And this also means that "extending C90" (or any other C standard) is an oxymoron, counter to the whole point of standards, and the antithesis of
    why C has remained popular (or at least useful) for so long.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Paul Edwards on Tue May 20 14:23:33 2025
    On 20/05/2025 11:36, Paul Edwards wrote:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87ecwj1vy9.fsf@nosuchdomain.example.com...
    "Paul Edwards" <mutazilah@gmail.com> writes:


    And C90 (etc) could potentially be extended to include a folder.h

    C90 will never be extended. It was made obsolete by C99, which was made
    obsolete by C11, which was made obsolete by C23. You're free to invent
    your own language based on C90 if you like, but C went in a different
    direction decades ago.

    That depends on your definition of "C". Ritchie is no longer here to adjudicate whether something close to C90 - in the spirit of the
    original C, is the true successor to his language, and which one is
    a complete and utter joke of no relation to anything he designed.


    Once C was standardised - first by ANSI, then immediately afterwards by
    ISO - the "definition of C" became clear. The language is covered by an international standard, so "C" is the language defined by that standard.
    Thus "C" means "C23" at the moment - each newly published C standard
    "cancels and replaces" the previous version. Ritchie's opinion hasn't
    had any connection to the "definition of C" since 1989. I don't know if
    he ever expressed a public opinion on C99, or the plans for C11. I
    would, however, be astounded if he had considered it "a complete and
    utter joke of no relation to anything he designed".

    (And while I don't think that an "appeal to authority" argument has much
    merit, he did say that he found Linux "quite delightful" as a
    continuation of UNIX, and I would not expect him to have viewed your OS
    ideas as productive.)

    A semantic debate that doesn't answer my question either way anyway.


    You did ask us not to give the obvious answer to your original post.

    But Keith is absolutely correct here. C90 is C90, and will remain that
    way (baring the very unlikely possibility of minor technical corrections).

    You can make your own libraries, and OS's, and extensions, and languages
    - whatever makes you happy. (And if you enjoy what you are doing, and
    it's not harming anyone, then that's all the reason you need. You don't
    need approval from anyone else. Don't let me or anyone else hinder you enjoying yourself.) However, nothing that you ever do will be an
    extension to C90.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Kaz Kylheku on Tue May 20 15:05:01 2025
    On 20/05/2025 14:55, Kaz Kylheku wrote:
    On 2025-05-20, Richard Heathfield <rjh@cpax.org.uk> wrote:
    On 20/05/2025 10:18, Keith Thompson wrote:
    C90 will never be extended.

    And for that reason it will always be valuable. Stability has a
    value all its own.

    Windows Vista will never be extended either.

    Certainly the version on one of my ancient laptops never will be.
    Indeed, I deprive it of an Internet connection for precisely that
    reason. Vista is what it is, and has no business changing. If I
    want to change the OS I'll buy a bloody CD-ROM.

    Operating systems have least excuse of all for turning rock into
    sand. It's harder to build stable software if it has to sit on
    top of amorphous gloop.

    Did I say 'harumph' yet? No?

    HARUMPH!

    So there.

    --
    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 Kaz Kylheku@21:1/5 to Richard Heathfield on Tue May 20 13:55:18 2025
    On 2025-05-20, Richard Heathfield <rjh@cpax.org.uk> wrote:
    On 20/05/2025 10:18, Keith Thompson wrote:
    C90 will never be extended.

    And for that reason it will always be valuable. Stability has a
    value all its own.

    Windows Vista will never be extended either.

    --
    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 Kaz Kylheku@21:1/5 to Paul Edwards on Tue May 20 13:53:58 2025
    On 2025-05-20, Paul Edwards <mutazilah@gmail.com> wrote:
    The folder routines will do everything I need.

    Except be written in C90?

    --
    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 Muttley@DastardlyHQ.org@21:1/5 to All on Tue May 20 14:09:50 2025
    On Tue, 20 May 2025 15:05:01 +0100
    Richard Heathfield <rjh@cpax.org.uk> wibbled:
    Operating systems have least excuse of all for turning rock into
    sand. It's harder to build stable software if it has to sit on
    top of amorphous gloop.

    On a related note, I can still compile unix C code I wrote in the 90s at uni without any changes on linux and mac.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Paul Edwards on Tue May 20 15:37:46 2025
    [This should be fun.]

    On 20/05/2025 14:47, Paul Edwards wrote:
    "David Brown" <david.brown@hesbynett.no> wrote in message news:100hs85$27qbn$1@dont-email.me...
    On 20/05/2025 11:36, Paul Edwards wrote:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message
    news:87ecwj1vy9.fsf@nosuchdomain.example.com...
    "Paul Edwards" <mutazilah@gmail.com> writes:

    And C90 (etc) could potentially be extended to include a folder.h

    directory.h, damn you! Folders are for schoolteachers, not
    programmers. We could fall out over this.


    C90 will never be extended. It was made obsolete by
    C99, which was made obsolete by C11, which was made
    obsolete by C23. You're free to invent your own language
    based on C90 if you like, but C went in a different
    direction decades ago.

    That depends on your definition of "C". Ritchie is no longer here to
    adjudicate whether something close to C90 - in the spirit of the
    original C, is the true successor to his language, and which one is
    a complete and utter joke of no relation to anything he designed.


    Once C was standardised - first by ANSI, then immediately afterwards by
    ISO - the "definition of C" became clear.

    Yes, I agree with that.

    So do I. So far, so good.

    The language is covered by an
    international standard, so "C" is the language defined by that standard.
    Thus "C" means "C23" at the moment - each newly published C standard
    "cancels and replaces" the previous version.

    I don't agree with this. I'm sure the ISO committee is keen
    to "cancel" the previous work.

    Whether you agree with David or not, he's correct. He has
    accurately described the way the world sees C.

    You might argue that the world sees it wrong, and who am I to
    dissuade you? But ISO has far more clout than you or me, alas.

    But I have a different opinion.

    I doubt that I am alone.

    It would seem not. Pull up a chair.

    I'm probably in a minority, but so what?

    You're in /my/ minority, but that's okay; there's plenty of room.

    Ritchie's opinion hasn't
    had any connection to the "definition of C" since 1989. I don't know if
    he ever expressed a public opinion on C99, or the plans for C11. I
    would, however, be astounded if he had considered it "a complete and
    utter joke of no relation to anything he designed".

    Well, in the 1990s I had some work colleagues who were
    incensed that I had converted some K&R C code to C90,
    and called it "nancy C". I pointed out that Ritchie himself
    had endorsed the standard, and they still didn't budge,
    saying that he had become deranged or something like that.

    Ritchie single-handedly fought off noalias. Deranged my foot! All
    his marbles present and correct, and every marble a winner.

    From another corner I still deal with people who insist
    that everything should be written in assembler.

    Computer scientists hunt elephants by exercising Algorithm
    A:
    1. Go to Africa
    2. Start at the Cape of Good Hope
    3. Work northwards in an orderly manner, traversing the continent
    alternately east and west.
    4. During each traverse pass,
    (a) Catch each animal seen
    (b) Compare each animal caught to a known elephant
    (c) Stop when a match is detected

    Experienced programmers modify Algorithm A by placing
    a known elephant in Cairo to ensure that the algorithm will
    terminate.

    Assembly language programmers prefer to execute
    Algorithm A on their hands and knees.

    And in another corner, there are people who claim that I
    am at fault for not making "my" compiler (a slight variation
    of gcc 3.2.3) run in under 16 MiB of memory.

    Mibs are marbles. You can't run a C compiler under 16 marbles,
    not even if you bring in Dennis Ritchie.

    I understand where these people are coming from.

    So do I, but I expect it was a typo for 16 GB.

    And I can see the alternative described by that Jeff article
    I referenced.

    But my starting position is that I (sort of) can't personally
    fault the C90 standard, and the assembler code produced
    by a typical C compiler is exemplary, and that this is the
    basis for the lingua franca of programming.

    Right.

    (And while I don't think that an "appeal to authority" argument has much
    merit, he did say that he found Linux "quite delightful" as a
    continuation of UNIX, and I would not expect him to have viewed your OS
    ideas as productive.)

    I'm not asking him to approve my OS ideas. I'm asking him
    to explain what is wrong with the C90 that he approved of,
    and whether my mentioned extensions are reasonable.

    I'm afraid we're about 13½ years too late to expect an answer
    from the man himself, but I could guess at his answers:

    (a) nothing;
    (b) they make a reasonable library, but there's no reason to
    change C90. If people find the library useful, they will use it
    and the word will spread.

    But Keith is absolutely correct here. C90 is C90, and will remain that
    way (baring the very unlikely possibility of minor technical corrections). >>
    You can make your own libraries, and OS's, and extensions, and languages
    - whatever makes you happy. (And if you enjoy what you are doing, and
    it's not harming anyone, then that's all the reason you need. You don't
    need approval from anyone else. Don't let me or anyone else hinder you
    enjoying yourself.) However, nothing that you ever do will be an
    extension to C90.

    You seem to have a different definition of "extension to C90" to me, then.

    Then what do you mean by it? I suspect David thinks you mean an
    update to the ISO C90 document requiring all conforming C
    compilers to adopt your new library. And, like me, Keith and
    David know full well that that ain't gonna happen.


    Which is also fine.

    Regardless, I intend to compete with the ISO committee, and
    not so much start from scratch, as start from C90.

    My branch may not appeal to a majority, but I'm not particularly
    trying to appeal to a majority. I'm interested in appealing to the
    people who I work with (e.g. author of pdld). And I'm also
    interested in technical guidance from the majority who likely
    have more technical skills than me, regardless of whether they
    agree with my approach/goals or not (spoiler: they don't).

    If you want to publish a library, nobody is going to argue
    against you doing so. You can't have too many libraries. (Well, I
    expect you can, but it's hard.)

    --
    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 Richard Heathfield@21:1/5 to Paul Edwards on Tue May 20 16:02:14 2025
    On 20/05/2025 15:48, Paul Edwards wrote:

    <snip>

    My main development machine/environment is Windows 2000
    Would everybody please close their eyes and bow their heads?

    60
    59
    58
    57
    56
    55
    54
    53
    52
    51
    50
    49
    48
    47
    46
    45
    44
    43
    42
    41
    40
    39
    38
    37
    36
    35
    34
    33
    32
    31
    30
    29
    28
    27
    26
    25
    24
    23
    22
    21
    20
    19
    18
    17
    16
    15
    14
    13
    12
    11
    10
    9
    8
    7
    6
    5
    4
    3
    2
    1
    0

    Thank you.

    --
    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 Richard Heathfield@21:1/5 to Paul Edwards on Tue May 20 16:43:05 2025
    On 20/05/2025 16:11, Paul Edwards wrote:
    "Richard Heathfield" <rjh@cpax.org.uk> wrote in message news:100i43s$29dr0$1@dont-email.me...
    [This should be fun.]

    On 20/05/2025 14:47, Paul Edwards wrote:
    "David Brown" <david.brown@hesbynett.no> wrote in message
    news:100hs85$27qbn$1@dont-email.me...
    On 20/05/2025 11:36, Paul Edwards wrote:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message
    news:87ecwj1vy9.fsf@nosuchdomain.example.com...
    "Paul Edwards" <mutazilah@gmail.com> writes:

    And C90 (etc) could potentially be extended to include a folder.h

    directory.h, damn you! Folders are for schoolteachers, not
    programmers. We could fall out over this.

    What we'll fall out over is you exceeding the limits of
    MSDOS 8.3 filenames. :-)

    I did actually think about that (only for about a microsecond,
    but yes, I used to think it was a big deal).

    <snip>

    And in another corner, there are people who claim that I
    am at fault for not making "my" compiler (a slight variation
    of gcc 3.2.3) run in under 16 MiB of memory.

    Mibs are marbles. You can't run a C compiler under 16 marbles,
    not even if you bring in Dennis Ritchie.

    Pardon?

    https://en.wiktionary.org/wiki/mib

    Noun

    mib (plural mibs)

    (games) A marble (glass ball used in games), especially one
    used as a target.

    (Don't miss the quotations - priceless!)

    I also use Microsoft C 6.0 which was the
    last version to run on a PC XT in 640 KiB.

    Well, kib turns out to be Sumerian for "leash". Naturally, I
    prefer "unleashed".


    gcc 3.2.3 will run in under 16 MiB if I switch off optimization.

    I understand where these people are coming from.

    So do I, but I expect it was a typo for 16 GB.

    Nope.

    Clearly humour has failed me on this occasion.

    If you're allowed to get all uppity about 9-letter filenames
    (which uppityness I absolutely understand and respect), I reserve
    the right to insist on KB, MB, and GB instead of these
    nonsensical new inventions. The world knows full well that bit
    and byte prefixes are measured in powers of 2, and we don't need
    an intrusive iota irresponsibly interceding itself into initialisms.

    But my starting position is that I (sort of) can't personally
    fault the C90 standard, and the assembler code produced
    by a typical C compiler is exemplary, and that this is the
    basis for the lingua franca of programming.

    Right.

    Certainly great to have company!

    Today comp.lang.c, tomorrow ISO/IEC JTC 1/SC 22/WG 14 !

    <snip 1 - no comment>


    <snip 2 - Ce n'est pas ma tasse de thé.>

    Or to put it another way - if you didn't have time pressure,
    and the world was willing to stop writing code circa 1986
    until C had been standardized, and with the benefit of
    hindsight - what should or shouldn't be in a C90 or C2090 -
    however long it takes to "get it right"?

    fclose would take a FILE ** instead of FILE *, and its dying act
    would be *fp = NULL;

    qsort and bsearch would take context pointers to pass to cmp.

    non-blocking sockets would be in the standard, using an interface
    based on fopen/fread/fwrite/fclose.

    If I'm only allowed three, those would be the three I'd take.

    --
    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 Richard Heathfield@21:1/5 to David Brown on Tue May 20 17:43:17 2025
    On 20/05/2025 17:19, David Brown wrote:
    While there are some people who, for reasons that still escape
    me, prefer C90 over C99

    I will not fight you, David.

    --
    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 David Brown on Tue May 20 16:58:09 2025
    David Brown <david.brown@hesbynett.no> writes:
    On 20/05/2025 15:47, Paul Edwards wrote:

    Well, in the 1990s I had some work colleagues who were
    incensed that I had converted some K&R C code to C90,
    and called it "nancy C". I pointed out that Ritchie himself
    had endorsed the standard, and they still didn't budge,
    saying that he had become deranged or something like that.


    They were justified in thinking that "Richie himself endorsed the
    standard" is a totally irrelevant argument. They would be wrong if they
    said he had "become deranged".

    David, it's not particularly productive to continue to feed the trolls.

    Mr. Edwards also believes that MS-DOS is the be-all and end-all of operating systems.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to David Brown on Tue May 20 16:51:36 2025
    On 2025-05-20, David Brown <david.brown@hesbynett.no> wrote:
    On 20/05/2025 15:47, Paul Edwards wrote:
    "David Brown" <david.brown@hesbynett.no> wrote in message
    news:100hs85$27qbn$1@dont-email.me...
    On 20/05/2025 11:36, Paul Edwards wrote:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message
    news:87ecwj1vy9.fsf@nosuchdomain.example.com...
    "Paul Edwards" <mutazilah@gmail.com> writes:


    And C90 (etc) could potentially be extended to include a folder.h

    C90 will never be extended. It was made obsolete by C99, which was
    made
    obsolete by C11, which was made obsolete by C23. You're free to invent >>>>> your own language based on C90 if you like, but C went in a different >>>>> direction decades ago.

    That depends on your definition of "C". Ritchie is no longer here to
    adjudicate whether something close to C90 - in the spirit of the
    original C, is the true successor to his language, and which one is
    a complete and utter joke of no relation to anything he designed.


    Once C was standardised - first by ANSI, then immediately afterwards by
    ISO - the "definition of C" became clear.

    Yes, I agree with that.

    Then why do think that something might depend on someone's "definition
    of C" ? The definition of C is clear - it is what the international
    standard says it is. You can have other C-like languages, but they are
    not C.

    Sure they are. For instance the GNU C dialect family is C, and so is
    every vendor's dialect.

    Only ISO C is ISO C. ISO C is C, and so are some other things.

    The language is covered by an
    international standard, so "C" is the language defined by that standard. >>> Thus "C" means "C23" at the moment - each newly published C standard
    "cancels and replaces" the previous version.

    I don't agree with this.

    You don't get to have an opinion on facts. What I said is /fact/ - you
    can look at what it says in each new version of the C standards. This
    is also normal practice for ISO standards.

    The Bible says it's the word of God; that don't make it true.

    C90 and C99 are C languages which continue to be defined and exist.

    Moreover, every C++ dialect, current and historic, is also a C dialect!

    You can have an opinion as to whether or not you like the ISO practices,
    but not on what those practices are.

    The ISO practices don't dictate to the world what is a dialect of C.
    They do *produce* dialects of C, undeniably.

    They only produce; they do not destroy dialects of C.

    It's very hard to destroy languages; civilization still hashaccess to
    (and interest in) thousands-of-years-old languages.

    Again, you don't get to have an opinion on what the ISO committees
    practices are - you only get to have an opinion on whether or not you
    like them.

    But it's a fact that ISO cannot cancel anything in the world. All they
    can do is express the opinion that they consider a document, and what it describes, to be obsolete, not to assert that it doesn't exist.

    --
    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 David Brown@21:1/5 to Paul Edwards on Tue May 20 18:19:47 2025
    On 20/05/2025 15:47, Paul Edwards wrote:
    "David Brown" <david.brown@hesbynett.no> wrote in message news:100hs85$27qbn$1@dont-email.me...
    On 20/05/2025 11:36, Paul Edwards wrote:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message
    news:87ecwj1vy9.fsf@nosuchdomain.example.com...
    "Paul Edwards" <mutazilah@gmail.com> writes:


    And C90 (etc) could potentially be extended to include a folder.h

    C90 will never be extended. It was made obsolete by C99, which was
    made
    obsolete by C11, which was made obsolete by C23. You're free to invent >>>> your own language based on C90 if you like, but C went in a different
    direction decades ago.

    That depends on your definition of "C". Ritchie is no longer here to
    adjudicate whether something close to C90 - in the spirit of the
    original C, is the true successor to his language, and which one is
    a complete and utter joke of no relation to anything he designed.


    Once C was standardised - first by ANSI, then immediately afterwards by
    ISO - the "definition of C" became clear.

    Yes, I agree with that.

    Then why do think that something might depend on someone's "definition
    of C" ? The definition of C is clear - it is what the international
    standard says it is. You can have other C-like languages, but they are
    not C.


    The language is covered by an
    international standard, so "C" is the language defined by that standard.
    Thus "C" means "C23" at the moment - each newly published C standard
    "cancels and replaces" the previous version.

    I don't agree with this.

    You don't get to have an opinion on facts. What I said is /fact/ - you
    can look at what it says in each new version of the C standards. This
    is also normal practice for ISO standards.

    You can have an opinion as to whether or not you like the ISO practices,
    but not on what those practices are.

    I'm sure the ISO committee is keen
    to "cancel" the previous work.

    But I have a different opinion.

    I doubt that I am alone. I'm probably in a minority, but so what?


    Again, you don't get to have an opinion on what the ISO committees
    practices are - you only get to have an opinion on whether or not you
    like them. It is good to be clear on that difference.

    Now, you are certainly not alone in wanting to use older versions of the
    C standards despite them being "cancelled and replaced" by newer
    versions. And I think it is very common in the C world to appreciate
    that in practice, old versions are well supported by tools. (I
    typically write new projects to new standards, but I am very glad that
    tools still actively support old standards.)

    Ritchie's opinion hasn't
    had any connection to the "definition of C" since 1989. I don't know if
    he ever expressed a public opinion on C99, or the plans for C11. I
    would, however, be astounded if he had considered it "a complete and
    utter joke of no relation to anything he designed".

    Well, in the 1990s I had some work colleagues who were
    incensed that I had converted some K&R C code to C90,
    and called it "nancy C". I pointed out that Ritchie himself
    had endorsed the standard, and they still didn't budge,
    saying that he had become deranged or something like that.


    They were justified in thinking that "Richie himself endorsed the
    standard" is a totally irrelevant argument. They would be wrong if they
    said he had "become deranged".

    While there are some people who, for reasons that still escape me,
    prefer C90 over C99 when given a free choice (i.e., not required by
    toolchain limitations, project standards, etc.), I do not think many
    people consider K&R C to be superior to C90.

    From another corner I still deal with people who insist
    that everything should be written in assembler.


    Some things /are/ better written in assembler. Not many things, but
    some things.

    And in another corner, there are people who claim that I
    am at fault for not making "my" compiler (a slight variation
    of gcc 3.2.3) run in under 16 MiB of memory.


    Now you are stretching credulity.

    I understand where these people are coming from.

    And I can see the alternative described by that Jeff article
    I referenced.


    Few people click on random links. If you have something to say, say it.

    But my starting position is that I (sort of) can't personally
    fault the C90 standard, and the assembler code produced
    by a typical C compiler is exemplary, and that this is the
    basis for the lingua franca of programming.

    (And while I don't think that an "appeal to authority" argument has much
    merit, he did say that he found Linux "quite delightful" as a
    continuation of UNIX, and I would not expect him to have viewed your OS
    ideas as productive.)

    I'm not asking him to approve my OS ideas. I'm asking him
    to explain what is wrong with the C90 that he approved of,
    and whether my mentioned extensions are reasonable.


    You can ask him anything you like - just don't be surprised if he does
    not answer.

    I never knew Ritchie personally, and can only make guesses as to what he
    might think or say. I would, however, be very surprised if he
    considered C90 to be "perfect" or in any sense complete, or that he
    disapproved of the C standards committee moving forward with the
    language. I expect that like most of us, he would like some parts of
    each new standard, and dislike other parts - some parts he would find
    useful, and others not so much. And he would be happy to accept that
    the language is not for him personally - it's fine to have features that
    are of use and interest to other people.

    But Keith is absolutely correct here. C90 is C90, and will remain that
    way (baring the very unlikely possibility of minor technical corrections). >>
    You can make your own libraries, and OS's, and extensions, and languages
    - whatever makes you happy. (And if you enjoy what you are doing, and
    it's not harming anyone, then that's all the reason you need. You don't
    need approval from anyone else. Don't let me or anyone else hinder you
    enjoying yourself.) However, nothing that you ever do will be an
    extension to C90.

    You seem to have a different definition of "extension to C90" to me, then.


    You suggested "extending C90" with the inclusion of your new functions.
    That's the definition of "extension to C90" I am using.

    Which is also fine.

    Regardless, I intend to compete with the ISO committee, and
    not so much start from scratch, as start from C90.


    You don't lack ambition!

    My branch may not appeal to a majority, but I'm not particularly
    trying to appeal to a majority. I'm interested in appealing to the
    people who I work with (e.g. author of pdld). And I'm also
    interested in technical guidance from the majority who likely
    have more technical skills than me, regardless of whether they
    agree with my approach/goals or not (spoiler: they don't).


    I have no problem with giving technical advice (if I have any that I
    think will be useful - I work with a significantly different type of programming, however). But I think you'd get on a lot better if you
    said you were trying to write a C90 library of functions for directory
    access, and dropped the bizarre doomsday philosophy. Choose C90 for
    maximal portability, or personal preference - that's fine. Trying to
    convince other people that C90 is somehow "perfect" while C99 is a
    "complete and utter joke" is not going to get you much technical help.
    Telling us that you are doing all this to be "apocalypse-ready" simply
    brands you as a delusional nutcase. And while I think delusional
    nutcases (as long as they are non-violent) have as much right to get
    technical answers as the next person, it really does distract from the C-related questions you have.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Scott Lurndal on Tue May 20 18:09:24 2025
    On 20/05/2025 17:58, Scott Lurndal wrote:
    David Brown <david.brown@hesbynett.no> writes:
    On 20/05/2025 15:47, Paul Edwards wrote:

    Well, in the 1990s I had some work colleagues who were
    incensed that I had converted some K&R C code to C90,
    and called it "nancy C". I pointed out that Ritchie himself
    had endorsed the standard, and they still didn't budge,
    saying that he had become deranged or something like that.


    They were justified in thinking that "Richie himself endorsed the
    standard" is a totally irrelevant argument. They would be wrong if they
    said he had "become deranged".

    David, it's not particularly productive to continue to feed the trolls.

    I'm not entirely sure (yet, at least) that 'troll' is a fair
    assessment of Mr Edwards. Time will tell.

    Mr. Edwards also believes that MS-DOS is the be-all and end-all of operating systems.

    Citation needed. He has mentioned it in passing... I just trawled
    through all his articles in this thread, and I just found that
    one fleeting reference.

    Perhaps I missed it. Would you be so kind as to point out why you
    believe that "Mr. Edwards also believes that MS-DOS is the be-all
    and end-all of operating systems"?

    --
    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 Kaz Kylheku@21:1/5 to Richard Heathfield on Tue May 20 17:14:22 2025
    On 2025-05-20, Richard Heathfield <rjh@cpax.org.uk> wrote:
    On 20/05/2025 17:19, David Brown wrote:
    While there are some people who, for reasons that still escape
    me, prefer C90 over C99

    I will not fight you, David.

    // For some reason that escapes me, I have a crash.

    char *me(void)
    {
    char reason[42];
    return reason;
    }

    --
    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 Scott Lurndal@21:1/5 to Richard Heathfield on Tue May 20 17:48:44 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 20/05/2025 17:58, Scott Lurndal wrote:
    David Brown <david.brown@hesbynett.no> writes:
    On 20/05/2025 15:47, Paul Edwards wrote:

    Well, in the 1990s I had some work colleagues who were
    incensed that I had converted some K&R C code to C90,
    and called it "nancy C". I pointed out that Ritchie himself
    had endorsed the standard, and they still didn't budge,
    saying that he had become deranged or something like that.


    They were justified in thinking that "Richie himself endorsed the
    standard" is a totally irrelevant argument. They would be wrong if they >>> said he had "become deranged".

    David, it's not particularly productive to continue to feed the trolls.

    I'm not entirely sure (yet, at least) that 'troll' is a fair
    assessment of Mr Edwards. Time will tell.

    Mr. Edwards also believes that MS-DOS is the be-all and end-all of operating >> systems.

    Citation needed. He has mentioned it in passing... I just trawled
    through all his articles in this thread, and I just found that
    one fleeting reference.

    Perhaps I missed it. Would you be so kind as to point out why you
    believe that "Mr. Edwards also believes that MS-DOS is the be-all
    and end-all of operating systems"?

    There are a decade of relevent threads on alt.os.development
    discussing his PDOS/386 project.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Kaz Kylheku on Tue May 20 18:20:06 2025
    On 20/05/2025 18:14, Kaz Kylheku wrote:
    On 2025-05-20, Richard Heathfield <rjh@cpax.org.uk> wrote:
    On 20/05/2025 17:19, David Brown wrote:
    While there are some people who, for reasons that still escape
    me, prefer C90 over C99

    I will not fight you, David.

    // For some reason that escapes me, I have a crash.

    char *me(void)
    {
    char reason[42];
    return reason;
    }

    Don't give up the day job, Kaz. ;-)

    Sure, you can do stupid things in any dialect of C.

    I think it was Doug Gwyn who said that if you set out to make it
    impossible to do stupid things in C, you'll end up making it
    impossible to do clever things.

    --
    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 Richard Heathfield on Tue May 20 17:51:08 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 20/05/2025 18:14, Kaz Kylheku wrote:
    On 2025-05-20, Richard Heathfield <rjh@cpax.org.uk> wrote:
    On 20/05/2025 17:19, David Brown wrote:
    While there are some people who, for reasons that still escape
    me, prefer C90 over C99

    I will not fight you, David.

    // For some reason that escapes me, I have a crash.

    char *me(void)
    {
    char reason[42];
    return reason;
    }

    Don't give up the day job, Kaz. ;-)

    Sure, you can do stupid things in any dialect of C.

    I think it was Doug Gwyn who said that if you set out to make it
    impossible to do stupid things in C, you'll end up making it
    impossible to do clever things.

    Define "clever" in this context. Duff's Device?

    Most "clever" code often ends up being not very maintainable in the
    long run, or sometimes is broken by a simple architectural enhancement.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Scott Lurndal on Tue May 20 19:50:06 2025
    On 20/05/2025 18:51, Scott Lurndal wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 20/05/2025 18:14, Kaz Kylheku wrote:
    On 2025-05-20, Richard Heathfield <rjh@cpax.org.uk> wrote:
    On 20/05/2025 17:19, David Brown wrote:
    While there are some people who, for reasons that still escape
    me, prefer C90 over C99

    I will not fight you, David.

    // For some reason that escapes me, I have a crash.

    char *me(void)
    {
    char reason[42];
    return reason;
    }

    Don't give up the day job, Kaz. ;-)

    Sure, you can do stupid things in any dialect of C.

    I think it was Doug Gwyn who said that if you set out to make it
    impossible to do stupid things in C, you'll end up making it
    impossible to do clever things.

    Define "clever" in this context. Duff's Device?

    :-)

    I doubt very much whether that's what Doug Gwyn had in mind. He
    always struck me as being a very level-headed fellow. He'd have
    been talking about wise-clever, not smartarse-clever.

    But nosing around the Web, I have discovered that he was talking
    not about C but about Unix. <oh well>

    Most "clever" code often ends up being not very maintainable in the
    long run, or sometimes is broken by a simple architectural enhancement.

    Certainly true. I once wrote a stunningly clever program in a 4GL
    - something to be really proud of. (Okay, so I was being a
    smart-arse, but in a good way.)

    Dan was tasked with a modification that didn't fit into my quite
    brilliant scheme. He had to rip it apart and start from scratch.
    He told me he felt like a barbarian at the gates of Rome, but the
    job comes first, of course,and so Rome burned. Ah well.

    As for Kaz's bug, I have enough confidence in Kaz to be sure that
    he wouldn't be so damn stupid in real code. I don't suppose you
    would be either, and I'd like to think that I'm better than that too.

    If we have to be hand-held through what we can and cannot do with
    local objects, we have no business writing production code.

    --
    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 Richard Heathfield@21:1/5 to Scott Lurndal on Tue May 20 19:34:08 2025
    On 20/05/2025 18:48, Scott Lurndal wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 20/05/2025 17:58, Scott Lurndal wrote:

    <snip>


    Mr. Edwards also believes that MS-DOS is the be-all and end-all of operating
    systems.

    Citation needed. He has mentioned it in passing... I just trawled
    through all his articles in this thread, and I just found that
    one fleeting reference.

    Perhaps I missed it. Would you be so kind as to point out why you
    believe that "Mr. Edwards also believes that MS-DOS is the be-all
    and end-all of operating systems"?

    There are a decade of relevent threads on alt.os.development
    discussing his PDOS/386 project.

    Oh, I see. Well, I'll have to take your word for that; life's too
    short. But thank you for clearing that up.

    --
    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 Kaz Kylheku@21:1/5 to Richard Heathfield on Tue May 20 19:34:50 2025
    On 2025-05-20, Richard Heathfield <rjh@cpax.org.uk> wrote:
    On 20/05/2025 18:14, Kaz Kylheku wrote:
    On 2025-05-20, Richard Heathfield <rjh@cpax.org.uk> wrote:
    On 20/05/2025 17:19, David Brown wrote:
    While there are some people who, for reasons that still escape
    me, prefer C90 over C99

    I will not fight you, David.

    // For some reason that escapes me, I have a crash.

    char *me(void)
    {
    char reason[42];
    return reason;
    }

    Don't give up the day job, Kaz. ;-)

    Sure, you can do stupid things in any dialect of C.

    I think it was Doug Gwyn who said that if you set out to make it
    impossible to do stupid things in C, you'll end up making it
    impossible to do clever things.

    But:

    "There's such a fine line between clever and stupid" -- Nigel Tufnel

    --
    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 Kaz Kylheku@21:1/5 to Paul Edwards on Tue May 20 22:50:47 2025
    On 2025-05-20, Paul Edwards <mutazilah@gmail.com> wrote:
    "Richard Heathfield" <rjh@cpax.org.uk> wrote in message news:100i7ub$2aaj2$1@dont-email.me...

    If you're allowed to get all uppity about 9-letter filenames
    (which uppityness I absolutely understand and respect), I reserve
    the right to insist on KB, MB, and GB instead of these
    nonsensical new inventions. The world knows full well that bit
    and byte prefixes are measured in powers of 2, and we don't need
    an intrusive iota irresponsibly interceding itself into initialisms.

    There are places in computing where powers of 2 are not
    used, and sometimes it is important.

    "640 is not a power of 2 unless you're a DOS user."

    -- Murray Goldberg (in a lecture, decades ago)

    https://en.wikipedia.org/wiki/Murray_Goldberg

    --
    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 Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Wed May 21 00:10:35 2025
    On Tue, 20 May 2025 19:33:18 +1000, Paul Edwards wrote:

    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:100hase$24odp$1@dont-email.me...

    On Tue, 20 May 2025 16:06:19 +1000, Paul Edwards wrote:

    And in essence, when you read from a directory, the only thing you
    get is the filename.

    You want at least the type of entry as well, surely.

    <https://manpages.debian.org/readdir(3)>

    No - I'm not attempting to support such sophistication.

    It’s not about sophistication, it’s about efficiency in real-world operation. Without that, you will need to do a second lookup in nearly
    every common directory-traversal case.

    If it is actually a subdirectory, then that is indicated with a "/"
    at the end of the filename.

    What if it's a symlink to a directory?

    I guess that can be left as "implementation-defined". I would treat it
    the same as a hardlink, ie a directory.

    The key point about symlinks is they are not the same as hardlinks.

    As far as I am aware, IBM mainframes are the most important systems on
    the planet. The only professional ones too. Everything else is a clown
    show.

    You are aware wrong.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Wed May 21 00:12:48 2025
    On Tue, 20 May 2025 19:36:06 +1000, Paul Edwards wrote:

    Ritchie is no longer here to adjudicate whether something close to
    C90 - in the spirit of the original C, is the true successor to his
    language, and which one is a complete and utter joke of no relation
    to anything he designed.

    Remember also that his vision of C was something very much designed to
    work on a Unix-type OS. Or at least with a POSIX API layer underneath.
    Without that, C is a pretty sad language indeed.

    Which, incidentally, takes care of the issues you are trying to address
    here.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Paul Edwards on Wed May 21 00:18:15 2025
    On 2025-05-20, Paul Edwards <mutazilah@gmail.com> wrote:
    "Paul Edwards" <mutazilah@gmail.com> wrote in message news:100j09o$2f04b$1@dont-email.me...

    Manipulating directories is not as important as manipulating
    files. The C90 people didn't leave out file manipulation (I
    think the ISO Pascal people left it out, at least originally).

    Actually, I think it was program paramaters that weren't
    specified.

    But again - maybe it is C90 that was wrong to specify argc
    and argv and the Pascal people got it right.

    That depends on the philosophy of language standards.

    And I am not personally familiar with the philosophy of
    language standards.

    ANSI C was codifying a lot of existing practices.

    C programs starting with a main() function which takes argc and argv was
    in this category. It came from Unix, and C implementations on other
    platforms imitated that.

    C appeared as the systems programming language of Unix.
    C on Unix had a way to process directories via library
    functions.

    Implementors of C on other systems choose to implement some functions
    from Unix, and not others. They didn't implement the directory-related
    ones, rendering them nonportable, and unsuitable for standardizing
    into the language.

    From my understanding, C and Unix standardization were separate but
    somewhat coordinated efforts. Unix things that didn't get into C were standardized by the emerging Unix standard.

    Today, if I want a program tha tneeds to walk directories, I use the
    POSIX C library. It is widely implemented. The program won't run
    absolutely everywhere, but it will run on many embedded systems,
    as well as supercomputers, and everything in between.

    --
    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 Lawrence D'Oliveiro@21:1/5 to Richard Heathfield on Wed May 21 01:11:35 2025
    On Tue, 20 May 2025 16:43:05 +0100, Richard Heathfield wrote:

    ... I reserve the right to insist on KB, MB, and GB instead of these nonsensical new inventions.

    Looking at some old stuff on Bitsavers, it’s amusing to see descriptions
    that can’t decide if they have “64K” of RAM or “65K” ...

    non-blocking sockets would be in the standard, using an interface based
    on fopen/fread/fwrite/fclose.

    Does seem to reinforce the impression that a lot of the proposals for
    filling in functional gaps in C involve including features already
    available in POSIX ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Wed May 21 01:03:28 2025
    On Wed, 21 May 2025 10:25:07 +1000, Paul Edwards wrote:

    My programs work anywhere.

    We have very different goals.

    I sense a slight contradiction between those two statements.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Wed May 21 01:02:40 2025
    On Wed, 21 May 2025 09:09:19 +1000, Paul Edwards wrote:

    ... maybe it is C90 that was wrong to specify argc and argv and
    the Pascal people got it right.

    The only thing wrong with argc/argv is they should have been globals.

    You see how Python handles this, for example, with sys.argv.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Wed May 21 01:05:45 2025
    On Wed, 21 May 2025 07:41:12 +1000, Paul Edwards wrote:

    Basically the software industry is a joke. The advances have all been
    done by hardware engineers.

    Didn’t they use software to manage that?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Paul Edwards on Tue May 20 22:26:57 2025
    "Paul Edwards" <mutazilah@gmail.com> writes:
    ...
    When C90 was being written - or indeed - when K&R was
    being written - if there hadn't been pressure to "bring to market",
    would you EXPECT a language standard - any language
    standard - but in this specific instance the ISO/IEC 9899:1990
    committee - to have included a standard form of directory
    manipulation.> As far as I know, there was never any LOGICAL barrier
    to including basic directory manipulation in C90.

    There is a practical barrier - while C was developed in the context of
    Unix, which had a lot of influence on the design of C, that design has
    also always been motivated by a desire to, among other things, be as
    widely portable as possible. There is a wide variety of different ways
    to organize memory, and not all of those ways map well to a Unix-like
    directory structure. The most different structure that I'm personally
    familiar with is VMS, where the closest equivalent to a Unix directory
    was versioned. If you specify a directory with a version number, you get
    that version of that directory (if it exists); if you don't specify a
    version, by default you get the latest version.
    I'm sure there are more obscure cases that I'm not familiar with, and at
    the time when K&R was being written, the variety was even larger. By
    leaving directory handling up to OS routines, they avoided having to
    design the relevant C library functions so they could be implemented efficiently on that wide variety of platforms.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Richard Heathfield on Tue May 20 22:40:24 2025
    On 5/20/25 11:43, Richard Heathfield wrote:
    ...
    nonsensical new inventions. The world knows full well that bit
    and byte prefixes are measured in powers of 2, ...
    I must emphatically disagree - long before MiB was invented, I had
    arguments with people who were certain they were measured in powers of
    10, and could point at authorities supporting those views.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Keith Thompson on Wed May 21 02:21:58 2025
    On 2025-05-20, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message
    news:87a5770xjw.fsf@nosuchdomain.example.com...
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]
    So is it right to expect directories to be covered by C90?

    Of course not. C90 is frozen, defined by the ISO standard published
    in 1990. It is an obvious fact, that you cannot have missed,
    that the C90 standard does not support operations on directories.
    (Neither does any later ISO C standard.)

    I'm guessing that you meant something by "expect" that differs from
    its usual meaning. Can you clarify?

    When C90 was being written - or indeed - when K&R was
    being written - if there hadn't been pressure to "bring to market",
    would you EXPECT a language standard - any language
    standard - but in this specific instance the ISO/IEC 9899:1990
    committee - to have included a standard form of directory
    manipulation?

    Ah, that's a very different question. I have no answer, because
    I don't care. C90 is what it is. Of course it could have been different.

    [...]

    As far as I know, there was never any LOGICAL barrier
    to including basic directory manipulation in C90.

    None that I can think of.

    There was a significant barrier. The ANSI group which standardized
    C was mainly looking at surveying and codifying existing practice.

    They were not doing wholesale invention of mechanisms not already
    portable.

    They did add some things like the void type from C++ and function
    prototypes, inventing the (void) parameter list not found in C++ for
    denoting a prototyped empty list (which C++ then copied back).

    Directory manipulation could be added to C similarly to the way
    threading was added: new platform abstractions that are implementable in
    terms of POSIX and other system interfaces.

    There could be some challenges there worse than threads, due to
    differences in path handling and other conventions.

    There is a difference between directory handling and threads in
    that threads serve the program. You select the threading interface,
    like POSIX or C11, and you design the solution around that.
    Directory handling is often imposed externally: programs processing
    directory trees are often expected to do so with high fidelity
    with respect to all the bells and whistles of the given system:
    permissions, time stamps, ACLs, file types beyond just file
    versus directory.

    A half-baked directory access interface that serves only a
    small subset of programs (which access only their own file-based
    data model that can be constrained to fall within the limitations)
    is not going to be worth pushing all the way up into the
    language standard.

    Sure, it would be theoretically possible to treat directories as files,
    and to make reading from a FILE* resulting from calling fopen() with a directory name give you access to the directory entries.

    I implemented something like this. It is fine; I don't regret it.

    (open-directory ".")
    #<dir-stream b7b90820>
    (get-line *1)
    "htrailer.txr"
    (get-line *1)
    "y.output.bison"
    (get-line *1)
    "jmp.S"
    (open-file "/etc/hosts")
    #<file-stream /etc/hosts b7b7a8b0>
    (get-line *5)
    "127.0.0.1\tlocalhost"
    (get-line *5)
    "127.0.1.1\tsun-go"

    Paul's proposed refinement of a trailing slash to indicate directories (versus any other filesystem object kind) is absent. You have to call an additional function if you want to know.

    I don't use this open-directory very much because there are other ways to get directory entries, like the ftw function (traverses trees), or glob (matches patterns).

    --
    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 Janis Papanagnou@21:1/5 to Paul Edwards on Wed May 21 04:35:24 2025
    On 20.05.2025 08:06, Paul Edwards wrote:
    Someone (Jean-Marc) wrote some "folder" routines which I like a lot.
    You can see them here:

    https://sourceforge.net/p/pdos/gitcode/ci/master/tree/hwzip/folder.c

    And in essence, when you read from a directory, the only
    thing you get is the filename. If it is actually a subdirectory,
    then that is indicated with a "/" at the end of the filename.

    Other things like size and creation date are not available,
    and C90 does not guarantee that such concepts even
    exist. C90 does guarantee that files exist though.

    And in fact, files are the only thing that are ever actually
    externally visible to a C90-compliant program.

    Now it so happens that I need to traverse directories.
    I want this to run on MVS/TSO as well as other environments,
    and I have a way of making directories appear, even though
    they don't really exist on the mainframe (traditional, like
    MVS 3.8J).

    So they will appear to be an 8.8 files, simlar to traditional
    8.3 with FAT.

    Plus I want to work with modern FAT long filenames, and
    Unix too.

    The folder routines will do everything I need.

    The mkfldr() routine won't work under my MVS/TSO design,
    but that doesn't bother me. I can probably make rmfldr() work,
    but don't intend to for now.

    Now C90 doesn't have folder/directory operations (such as
    opendir()) for a reason.

    That reason may cease to exist if I can demonstrate directories
    grafted onto the mainframe.

    And C90 (etc) could potentially be extended to include a folder.h

    Or this could be something that doesn't belong in the C standard.

    Or alternatively, this could be something incorporated within the
    C90 standard, as designed.

    I have already demonstrated zmodem working on a COM1
    stream opened with fopen (shipped with Freewindows at
    pdos.org). Interesting note is that I needed to escape the
    MSDOS x'1a' (EOF) because something was swallowing it.
    And I demonstrated it via my mainframe emulator too - giving
    the mainframe the ability to connect to a BBS and do a FREQ.
    Should work on real hardware too, using a TN3270 OSA/ICC
    as an encapsulation layer, as I previously demonstrated with
    an EBCDIC ANSI terminal.

    So the next thing that I would potentially encapsulate is
    something like this:

    fopen(argv[1], "w+");

    where the argument might be "/some/dir/" (with a terminating /
    for good measure).

    And then do a fputs("dir\n");

    And fgets() and collect each name from the folder, using something
    similar to those folder routines above - all done internally so not
    really relevant.

    Possibly a rewind() to reset the EOF condition of the fgets.
    Or maybe an fseek to offset 0 from SEEK_CUR.

    And fputs("mkdir subdir\n"); to make a subdirectory.

    And fputs("rmdir subdir\n"); to remove one.

    And fputs("cd ..\n"); to change directory.


    I'm wondering what the underlying principles here are that
    would govern the correct thing to do.

    Maybe I shouldn't be overloading the FILE concept to make
    an artificial file.

    Or maybe it is the other way around - we should perhaps
    eliminate lots of APIs - like the TCP/IP ones - and stick
    them all inside streams, and perhaps FILE is a misnomer,
    it should have really been called STREAM.

    Any thoughts (besides "get a life!")?

    Directories are like files entities that have to and are handled
    by the OS. Different OSes provide different interfaces to those
    functions. There's, for example, Unix systems that historically
    had differing interfaces. So standards have evolved (SUS, POSIX)
    to get a common interface for Unix systems. Those standards also
    define (besides the system calls) the other types of interfaces;
    the shell and the Unix utilities called from the shell. Besides
    the system calls (that are "incidentally" written and documented
    in the C language) there's the languages that may want their own
    abstractions; e.g. 'printf' (vs. 'write'). Such abstractions are
    certainly useful to be supported as library functions. And I'd
    write and provide directory abstractions also as add-on library
    functions (as opposed to part of a language; but my opinion on
    that is not strong). Historically other languages even missed to
    provide any I/O functions; vendors provided own (non-standard)
    functions. This had been considered a bad decision. There's also
    other abstractions to files and directories, like, e.g. the OSI
    and ITU-T standards for directories (X.500) and for file access
    and management (FTAM); both abstracted on the upper OSI layer 7.

    To sum up; on the way from the OS entity to the user interface
    there's various abstraction levels. Depending on the service I'd
    like to provide I'd probably choose different abstraction layers.
    I _don't_ think that a directory abstraction should be *inherent*
    part of the C language, but if necessary provided as a _library_.

    Just my opinion on (some of?) your questions. HTH.

    Janis


    Thanks. Paul.



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to James Kuyper on Wed May 21 03:32:52 2025
    On Tue, 20 May 2025 22:26:57 -0400, James Kuyper wrote:

    There is a practical barrier - while C was developed in the context of
    Unix, which had a lot of influence on the design of C, that design has
    also always been motivated by a desire to, among other things, be as
    widely portable as possible.

    Furthermore, back in that day, some OSes (like MS-DOS) were pretty limited
    in their functionality, without even multi-tasking capability.

    That situation has improved somewhat. Nowadays the world divides into POSIX-like versus non-POSIX-like. With the latter trying to become more POSIX-like over time.

    The most different structure that I'm personally familiar with is
    VMS, where the closest equivalent to a Unix directory was versioned.
    If you specify a directory with a version number, you get that
    version of that directory (if it exists); if you don't specify a
    version, by default you get the latest version.

    Only regular files were versioned; directories were files, but they were specially managed by the OS, and they had to have the .DIR suffix and the version number was always 1.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Wed May 21 03:37:00 2025
    On Wed, 21 May 2025 10:23:27 +1000, Paul Edwards wrote:

    Your definition of "real world", is probably "not C90".

    Precisely.

    Your "real world" applications won't work on traditional MVS ...

    Let’s face it: MVS stopped being part of the “real world” a long time ago.
    Just about the time IBM’s mainframe business started circling the gurgler.

    (Also, I think it’s called “z/OS” now.)

    The key point about symlinks is they are not the same as hardlinks.

    There is no such universal concept for either of those things,

    Yes there is: they are defined in POSIX, which is an official standard,
    after all.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to James Kuyper on Wed May 21 05:50:42 2025
    On 21/05/2025 03:40, James Kuyper wrote:
    On 5/20/25 11:43, Richard Heathfield wrote:
    ...
    nonsensical new inventions. The world knows full well that bit
    and byte prefixes are measured in powers of 2, ...
    I must emphatically disagree - long before MiB was invented, I had
    arguments with people who were certain they were measured in powers of
    10, and could point at authorities supporting those views.

    I must emphatically double down and insist that you were right
    and they were wrong wrong wrongawrong wrong.

    We are not alone, you and I. Maybe we could do a badge or
    something? Have your people talk to my people and we'll do lunch.

    --
    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 Richard Heathfield@21:1/5 to Paul Edwards on Wed May 21 05:31:57 2025
    On 20/05/2025 22:51, Paul Edwards wrote:
    That's a complete and utter lie.

    That's a complete and utter over-reaction.

    This group takes such things to heart. If you seek a helpful
    reaction from this group, you'd do better to keep the tone
    non-inflammatory and rebut such claims quietly and
    dispassionately rather than jump on your destrier and grab your
    lance. You've already been badged a 'troll'. Try not to let the
    cap fit.

    --
    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 David Brown@21:1/5 to Richard Heathfield on Wed May 21 10:09:27 2025
    On 20/05/2025 18:43, Richard Heathfield wrote:
    On 20/05/2025 17:19, David Brown wrote:
    While there are some people who, for reasons that still escape me,
    prefer C90 over C99

    I will not fight you, David.


    Ah - you escape along with your reasons :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Richard Heathfield on Wed May 21 10:06:47 2025
    On 21/05/2025 06:50, Richard Heathfield wrote:
    On 21/05/2025 03:40, James Kuyper wrote:
    On 5/20/25 11:43, Richard Heathfield wrote:
    ...
    nonsensical new inventions. The world knows full well that bit
    and byte prefixes are measured in powers of 2, ...
    I must emphatically disagree - long before MiB was invented, I had
    arguments with people who were certain they were measured in powers of
    10, and could point at authorities supporting those views.

    I must emphatically double down and insist that you were right and they
    were wrong wrong wrongawrong wrong.

    We are not alone, you and I. Maybe we could do a badge or something?
    Have your people talk to my people and we'll do lunch.


    The answer here, I think, is obvious. Instead of rolling back progress
    35 years to C90, we need to go further. In 1970 the perfect extendable programming language came to light - Forth. You can extend it in any
    way you like. There is an official ANSI standard, but AFAIK no ISO
    standard, with no change since 1994 (and people don't pay much attention
    to it anyway).

    Even better, you can write :

    : 2 1.995262315 ;

    and redefine "2" to be the tenth root of 1000. Now 2 ^ 10 = 1000, KiB
    and KB are identical, and the world is united again.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Scott Lurndal on Wed May 21 10:27:51 2025
    On 20/05/2025 18:58, Scott Lurndal wrote:
    David Brown <david.brown@hesbynett.no> writes:
    On 20/05/2025 15:47, Paul Edwards wrote:

    Well, in the 1990s I had some work colleagues who were
    incensed that I had converted some K&R C code to C90,
    and called it "nancy C". I pointed out that Ritchie himself
    had endorsed the standard, and they still didn't budge,
    saying that he had become deranged or something like that.


    They were justified in thinking that "Richie himself endorsed the
    standard" is a totally irrelevant argument. They would be wrong if they
    said he had "become deranged".

    David, it's not particularly productive to continue to feed the trolls.

    Mr. Edwards also believes that MS-DOS is the be-all and end-all of operating systems.

    If he can be persuaded to leave that kind of stuff out of his posts, he
    might talk more about C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to David Brown on Wed May 21 09:27:01 2025
    On 21/05/2025 09:06, David Brown wrote:
    On 21/05/2025 06:50, Richard Heathfield wrote:
    On 21/05/2025 03:40, James Kuyper wrote:
    On 5/20/25 11:43, Richard Heathfield wrote:
    ...
    nonsensical new inventions. The world knows full well that bit
    and byte prefixes are measured in powers of 2, ...

    I must emphatically disagree - long before MiB was
    invented, I had arguments with people who were certain
    they were measured in powers of 10, and could point at
    authorities supporting those views.

    I must emphatically double down and insist that you were right
    and they were wrong wrong wrongawrong wrong.

    We are not alone, you and I. Maybe we could do a badge or
    something? Have your people talk to my people and we'll do lunch.

    The answer here, I think, is obvious.  Instead of rolling back
    progress 35 years to C90, we need to go further.  In 1970 the
    perfect extendable programming language came to light - Forth.
    You can extend it in any way you like.  There is an official ANSI
    standard, but AFAIK no ISO standard, with no change since 1994
    (and people don't pay much attention to it anyway).

    Even better, you can write :

    : 2 1.995262315 ;

    and redefine "2" to be the tenth root of 1000.  Now 2 ^ 10 =
    1000, KiB and KB are identical, and the world is united again.

    When the chips are down and the balloon goes up and push finally
    comes to shove, comp.lang.c never disappoints.

    --
    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 Richard Heathfield@21:1/5 to Paul Edwards on Wed May 21 11:28:01 2025
    On 21/05/2025 11:08, Paul Edwards wrote:
    "Richard Heathfield" <rjh@cpax.org.uk> wrote in message news:100jkvt$2m0ln$1@dont-email.me...
    On 20/05/2025 22:51, Paul Edwards wrote:
    That's a complete and utter lie.

    That's a complete and utter over-reaction.

    Has no-one ever lied you saying something? Calling
    the lying statement a lie is hardly an over-reaction.
    Suing him for defamation of character might be though.
    Maybe. Only maybe.

    So sue him, and leave the verdict to a jury of your peers who
    will have absolutely no idea of what either of you are talking about.

    <boring rant snipped>

    I'll let that one slide, but if you want to have productive
    discussions in comp.lang.c, you need to calm down.

    --
    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 Richard Heathfield@21:1/5 to Paul Edwards on Wed May 21 12:06:03 2025
    On 21/05/2025 11:44, Paul Edwards wrote:

    <snip>


    The language standard would need to say something along
    the lines of "if any filenames contain a NL character, the
    results are implementation-defined".

    Any issue with that?

    Were this an ISO standard, making something
    implementation-defined would be a big deal, because it means:
    "unspecified behavior where each implementation documents how the
    choice is made." (See 3.4.1(1).)

    That is, it imposes a specific documentation requirement on each
    and every conforming implementation.

    Is that your intent? Because if it isn't, your language standard
    would need to think carefully about what /it/ means by "implementation-defined".

    --
    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 Keith Thompson on Wed May 21 13:59:44 2025
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    "Paul Edwards" <mutazilah@gmail.com> writes:

    <snip>


    See if a stream is known to have characters in it.

    I'd need a more precise explanation. Does it just return a
    true/false value? If so, how does it differ from feof() and/or
    ferror()? What would it do on an interactive stream? What is the
    use case?

    Moreover, what is the definition of 'character' in this context?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Paul Edwards on Wed May 21 16:46:06 2025
    On 21/05/2025 12:46, Paul Edwards wrote:
    "David Brown" <david.brown@hesbynett.no> wrote in message news:100k2q7$2o7b7$3@dont-email.me...
    On 20/05/2025 18:58, Scott Lurndal wrote:
    David Brown <david.brown@hesbynett.no> writes:
    On 20/05/2025 15:47, Paul Edwards wrote:

    Well, in the 1990s I had some work colleagues who were
    incensed that I had converted some K&R C code to C90,
    and called it "nancy C". I pointed out that Ritchie himself
    had endorsed the standard, and they still didn't budge,
    saying that he had become deranged or something like that.


    They were justified in thinking that "Richie himself endorsed the
    standard" is a totally irrelevant argument. They would be wrong if
    they
    said he had "become deranged".

    David, it's not particularly productive to continue to feed the trolls.

    Mr. Edwards also believes that MS-DOS is the be-all and end-all of
    operating
    systems.

    If he can be persuaded to leave that kind of stuff out of his posts, he
    might talk more about C.

    That statement of belief - nor anything close to that -
    exists in any of my recent, nor even my past, posts.

    So I have already done as requested - and always have.


    By "that kind of stuff" I meant anything related to your - let's
    diplomatically call them "unusual" - beliefs about operating systems,
    software, hardware, computers, standards, and pretty much anything you
    have posted about. I really don't care what operating systems you like
    or don't like. Stick to the questions about C itself - drop the
    fantasies you tell yourself to justify your ideas. No one cares about
    whether your code works on a decades-outdated mainframe, because your
    code will never be used on such systems. No one who uses a mainframe
    would let you or your code come within a mile of the machine.

    But if you say you want some advice on making a directory API in C that
    should work on a mainframe emulator, and you are doing it just for fun,
    then people will be happy to give any technical suggestions they have.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Paul Edwards on Wed May 21 17:00:36 2025
    On 21/05/2025 12:08, Paul Edwards wrote:
    "Richard Heathfield" <rjh@cpax.org.uk> wrote in message news:100jkvt$2m0ln$1@dont-email.me...
    On 20/05/2025 22:51, Paul Edwards wrote:
    That's a complete and utter lie.

    That's a complete and utter over-reaction.

    Has no-one ever lied you saying something? Calling
    the lying statement a lie is hardly an over-reaction.

    Yes, your post was an over-reaction.


    Your advice is better directed at Scott. He's the one
    who made the original inflammatory statement in
    question.

    You seem very touchy - Scott's post was hardly an "inflammatory"
    statement, regardless of whether it was true or not. If you are going
    to venture out in public on the internet, you need a much thicker skin
    than that.


    And try not to accept future ridiculous claims from Scott
    on trust. He's not trustworthy.


    Scott has a very long reputation in this and related newsgroups, and is
    very much a trustworthy poster. It can happen that he is wrong, or has misunderstood, or has forgotten things, or exaggerates - just like the
    rest of us. But that is very different from "lying".

    If Scott says that you appear to be a big fan of DOS, based on the
    impression he has got from some other group, then I believe him. If you
    say it is not the case, then I still believe that is the impression
    Scott got from your posts - though it might not be the impression you
    intended to give, and might not be the whole picture.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Paul Edwards on Wed May 21 17:07:50 2025
    On 21.05.2025 11:45, Paul Edwards wrote:
    "Janis Papanagnou" <janis_papanagnou+ng@hotmail.com> wrote in message news:100je5c$2l1b2$1@dont-email.me...

    certainly useful to be supported as library functions. And I'd
    write and provide directory abstractions also as add-on library
    functions (as opposed to part of a language; but my opinion on
    that is not strong). Historically other languages even missed to

    To sum up; on the way from the OS entity to the user interface
    there's various abstraction levels. Depending on the service I'd
    like to provide I'd probably choose different abstraction layers.
    I _don't_ think that a directory abstraction should be *inherent*
    part of the C language, but if necessary provided as a _library_.

    Sorry if I didn't specify that clearly.

    Of course I expect the directory handling to be in a library.

    Just as fopen() is in the library section of the C90 standard.

    The question is whether at least "half baked" directories
    should/could have been added the C90.

    The problem I see is that there are so many different types of
    directories depending on the OS; plain files (no directories),
    hierarchical with features like versions (VMS), a fixed set of
    individual hierarchies (DOS/Win), versions with one directory
    tree but with various attributes (e.g. access flags, ACLs), etc.

    It's thus a question of what abstraction you can and want provide.
    And that appears to be simpler with files than with directories.
    Simula, for example, has modeled files in a hierarchy of file
    types (infile, outfile, printfile, etc. as classes collected in
    an own class and usable like a module) and it would probably have
    been easy (i.e. now, not in 1967) to also model various types of
    directories and their properties as well in such an OO environment.

    "C" is simple (from its basic concepts), and of course you could
    collect some directory functions, or maybe support even different
    types of directories in a flat library with lot of special cases
    programmed to support if not all at least a couple directory types.

    The question of what constitutes a "C" language w.r.t. the various
    standards released over time has elsethread already been answered,
    and I don't want to (and don't have to) add anything to that.

    Because of the various aspects mentioned I wouldn't add that to
    C90 (but I also don't care much). From a programmers' perspective
    I'd not be delighted to have some library function be only defined
    for one "incompatible" version. I'd keep it in a separate library
    (as already said). Is there a reason that it would be standardized
    as part of the "C" language? I think, only if there's a sufficient
    coherence across various directory models (which I don't see).

    I had in most cases programmed on operating systems of one family;
    I never needed a "C" language library abstraction level of access
    to directories, I always used the OS specific libraries for that.
    My needs were and are covered by POSIX here.

    I see that a set of dedicated directory function [_restricted_ to
    a specific directory model] could be useful, but I don't see the
    necessity to add that to an old "C" language standard branch.

    (I'm not sure whether we spoke about the same or different things,
    or on cross-purpose, so I'll leave the discussion for the moment.)

    Janis


    It would have violated the "existing practice" spirit (which
    doesn't bother me - note - I failed to explicitly state this),
    but it wouldn't have violated the "portable" spirit.

    So long as you are careful and keep it "half-baked", you
    can have a portable file system in the spirit of C90
    portability.

    There were reasons this couldn't be done in 1990 (actually,
    it is C89 that matters here, so 1989 - and in fact, it was a
    static draft even earlier than that). But I wish to do it now,
    belatedly.

    BFN. Paul.



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Richard Heathfield on Wed May 21 16:03:49 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 21/05/2025 16:00, David Brown wrote:
    Scott has a very long reputation in this and related newsgroups,
    and is very much a trustworthy poster.

    In a society of strangers, it is easy to forget that some are
    less strange than others.

    Thanks to a zealot best forgotten, I have been AWOL from this
    group for a number of years, but on my recent return I lurked
    here for some while before dipping my toe back in the water, and
    I was glad to recognise a few old acquaintances (dare I say
    'friends'?) in the feed; strange though they undoubtedly are,
    they are less strange to me than others.

    Scott Lurndal is *not* a name I recall from a decade or so back

    My first post was to rec.radio.scanner in 1992, if I recall correctly.

    (Fluhrer yes, Lurndal not so much), but it quickly became
    apparent to me that he has become a regular fixture here, and one
    who is evidently respected by people whose opinion I have over
    decades come to respect. I am used to arguing with such people
    while retaining their respect for me and my respect for them. We
    do not generally snipe at each other, and when we do we try to
    snipe *gently*. I don't *know*, but I can at least *surmise* from
    the tangible respect in which he is held, that Mr Lurndal is of
    like mind.

    Indeed. I perhaps have a tendency to snipe a bit less gently
    when replying to certain posters when their opinions clash strongly
    with mine. A personal foible I try to control.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to David Brown on Wed May 21 16:37:35 2025
    On 21/05/2025 16:00, David Brown wrote:
    Scott has a very long reputation in this and related newsgroups,
    and is very much a trustworthy poster.

    In a society of strangers, it is easy to forget that some are
    less strange than others.

    Thanks to a zealot best forgotten, I have been AWOL from this
    group for a number of years, but on my recent return I lurked
    here for some while before dipping my toe back in the water, and
    I was glad to recognise a few old acquaintances (dare I say
    'friends'?) in the feed; strange though they undoubtedly are,
    they are less strange to me than others.

    Scott Lurndal is *not* a name I recall from a decade or so back
    (Fluhrer yes, Lurndal not so much), but it quickly became
    apparent to me that he has become a regular fixture here, and one
    who is evidently respected by people whose opinion I have over
    decades come to respect. I am used to arguing with such people
    while retaining their respect for me and my respect for them. We
    do not generally snipe at each other, and when we do we try to
    snipe *gently*. I don't *know*, but I can at least *surmise* from
    the tangible respect in which he is held, that Mr Lurndal is of
    like mind.

    I was hoping that Mr Edwards would be another such. I was (and
    remain) very ready to give him a fair crack at the whip, albeit
    not at the expense of people respected by people I respect, as it
    were. It seems that Mr Edwards may have come to us from a more
    combative environment where accusations of dishonesty are rife
    and hardly noticed; if so, it might take him a while to get used
    to a group where we generally treat such disrespectful tactics
    with contempt. Let us hope he learns quickly, before he ends up
    in too many killfiles.

    --
    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 Scott Lurndal on Wed May 21 20:21:33 2025
    On Wed, 21 May 2025 16:03:49 GMT
    scott@slp53.sl.home (Scott Lurndal) wrote:

    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 21/05/2025 16:00, David Brown wrote:
    Scott has a very long reputation in this and related newsgroups,
    and is very much a trustworthy poster.

    In a society of strangers, it is easy to forget that some are
    less strange than others.

    Thanks to a zealot best forgotten, I have been AWOL from this
    group for a number of years, but on my recent return I lurked
    here for some while before dipping my toe back in the water, and
    I was glad to recognise a few old acquaintances (dare I say
    'friends'?) in the feed; strange though they undoubtedly are,
    they are less strange to me than others.

    Scott Lurndal is *not* a name I recall from a decade or so back

    My first post was to rec.radio.scanner in 1992, if I recall correctly.


    Google groups search seems to think that you posted in comp.lang.c for
    the first time in Sep 8, 2007
    Then you posted irregularly for 10 years. Since May,2017 you started to
    post often.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Keith Thompson on Wed May 21 19:49:16 2025
    On 2025-05-21, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    On 2025-05-20, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]
    As far as I know, there was never any LOGICAL barrier
    to including basic directory manipulation in C90.

    None that I can think of.

    There was a significant barrier. The ANSI group which standardized
    C was mainly looking at surveying and codifying existing practice.

    Agreed. I consider that a practical barrier, not a "LOGICAL" one.

    The ANSI C committee *could* have added directory operations to the C standard library. (I'm not suggesting that they should have.)

    [...]

    Sure, it would be theoretically possible to treat directories as files,
    and to make reading from a FILE* resulting from calling fopen() with a
    directory name give you access to the directory entries.

    I implemented something like this. It is fine; I don't regret it.

    (open-directory ".")
    #<dir-stream b7b90820>
    (get-line *1)
    "htrailer.txr"
    (get-line *1)
    "y.output.bison"
    (get-line *1)
    "jmp.S"
    (open-file "/etc/hosts")
    #<file-stream /etc/hosts b7b7a8b0>
    (get-line *5)
    "127.0.0.1\tlocalhost"
    (get-line *5)
    "127.0.1.1\tsun-go"

    It looks like it treats a directory as a file containing a
    sequence of *lines*, each of which is a file name.

    I don't want to descend much farther into this culvert, but appearances
    are deceiving. The directory stream implementation takes liberty with interpreting thet get-line operation as if it were "get textual record"
    (where regular text streams define records as newline-terminated
    lines, but other streams not necessarily so).

    If a filename contains newline characters, they will be correctly
    returned as constituents of the string.

    (touch "foo\nbar")
    t
    (sh "ls foo*bar")
    'foo'$'\n''bar'
    0
    (find-if (op fnmatch "foo*bar") (get-lines (open-directory ".")))
    "foo\nbar"

    get-line is a principal stream operation, which is not understood as
    simply being a loop over get-char that reads until newline or EOF.
    A directory stream doesn't even support get-char:

    (get-char (open-directory "."))
    ** get-char: not supported by stream #<dir-stream b7b0dd80>
    ** during evaluation at expr-4:1 of form (get-char (open-directory "."))

    So thereby we duck out of answering the question of what character to
    return for record separator. If open-directory did provide get-char, I
    would lean toward making it produce the null character after each
    name.

    --
    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 Kaz Kylheku@21:1/5 to Paul Edwards on Wed May 21 19:31:13 2025
    On 2025-05-21, Paul Edwards <mutazilah@gmail.com> wrote:
    I don't need an official endorsement. What I need to know
    is that you can't think of any philosophical reason that the
    C90 committee shouldn't have done that - had they chosen
    to do so.

    That's like a double recursion: taking us into a subjunctive
    derived from an unrealized past!

    I think all the pieces are in the discussion until now to identify why
    it would have been a bad idea for C90 to try to provide directory
    access. A one-size fits all solution could easily have low fidelity for
    real programs whose users demand detailed platform integration, or else
    it could be a mess full of options and details that try to cover every
    system, but don't make sense on most of them.

    Common Lisp's pathnames are a good example of the latter. It's a
    complicated feature which has details that map to exotic filesystems
    that are no longer in use. MOreover, different implementations of
    Common Lisp for the same host systems vary in how they map certain
    details of pathname objects to the host operating system. For instance
    given the suffix .tar.gz on POSIX, one pathname implementations might
    treat just the "gz" as a the type attribute, whereas another might treat "tar.gz" as the type attribute.

    I think that if you're making some self-contained solution that must
    havce a hierarchical file system, and has to be in C90, then just
    code up a filesystem that exists entirely within one file that
    you can open for updating in binary mode using fopen("....", "r+b")
    and within which you create all the needed structure.

    Then you need not have a shred of anything system-specific
    in your file code.

    As an almost completely separate project, you could write a FUSE
    (filesystem in user space) module for Linux that would allow users to
    mount your filesystem image. This way images could be manipulated by
    something other than your software, which could come in handy.

    If you impelment an existing filesystem (like FAT32 or whatever)
    then that works is already done. Given a file containing a FAT32
    image, you can mount that on existing operating systems.
    That could help you in your development.

    --
    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 Scott Lurndal@21:1/5 to Keith Thompson on Wed May 21 20:58:07 2025
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    "Paul Edwards" <mutazilah@gmail.com> writes:

    <snip>

    I can't think of any other way to control an ASCII/EBCDIC
    ANSI X3.64 terminal without language/library support.

    But there's no such thing. I recall looking into this last time we
    discussed this, and ANSI X3.64 is defined in terms of ASCII. As far as
    I know, no existing terminal or emulator uses the EBCDIC escape
    character, and I see no need for a terminal that does so. (Terminals
    used with mainframes operate very differently.)

    Actually mainframe terminals, at least all those from Burroughs,
    supported only ASCII escape sequences. In the case of the Burroughs systems, the I/O subsystem translated from the host EBCDIC to the device
    ASCII during the hardware transfer, if requested by the programmer.

    IBM 3270 terminals did support EBCDIC, with an ASCII option available.

    Both were generally considered block-mode terminals and didn't support character level interactivity.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Keith Thompson on Wed May 21 21:02:14 2025
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message
    news:87h61ezf76.fsf@nosuchdomain.example.com...

    It looks like it treats a directory as a file containing a
    sequence of *lines*, each of which is a file name. The problem
    with that is that on some systems, file names can legally include
    newline characters. I don't suggest it's not a horrible idea to
    take advantage of that, but it is something that would have to be
    addressed in a language standard.

    And - that's part of my question.

    The language standard would need to say something along
    the lines of "if any filenames contain a NL character, the
    results are implementation-defined".

    No, it would not.

    I merely observed that one particular directory interface,
    if I understand it correctly, would not correctly handle files
    whose names contain a newline character. If you want to define a
    directory interface in your new language, I suggest that it should
    not have this limitation. If it doesn't have this limitation,
    there's no need to make the results implementation-defined.

    Accessing directories via fopen() would make it difficult but not
    impossible to handle such file names correctly. Perhaps that's one
    reason why (as far as I know) no existing directory interfaces use
    fopen().

    [...]

    Ditto MVS would be the reason why mkdir() can't be
    implemented - and mentioned in the Rationale, not the Standard.

    mkdir() could be defined in your standard library, but could always fail
    on MVS. (I'm assuming MVS doesn't support creating a directory.)
    Or you could leave it out, making your language less useful on systems
    that do support creating directories.

    MVS supported partitioned data sets (somewhat analogous to a
    traditional unix ar(1) archive).

    https://en.wikipedia.org/wiki/Data_set_(IBM_mainframe)#Partitioned_datasets

    Burroughs MCP, on the other hand, supported a form of directories (where
    there was one directory per storage unit[*], but no subdirectories).

    [*] which could consist of multiple hardware drives.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Waldek Hebisch@21:1/5 to Paul Edwards on Wed May 21 21:19:50 2025
    Paul Edwards <mutazilah@gmail.com> wrote:

    When C90 was being written - or indeed - when K&R was
    being written - if there hadn't been pressure to "bring to market",
    would you EXPECT a language standard - any language
    standard - but in this specific instance the ISO/IEC 9899:1990
    committee - to have included a standard form of directory
    manipulation?

    No need to speculate here: Common Lisp standard which is from
    similar period as C includes directory manipulation. In modern
    times this is considered one of least useful part of the
    language: to run "everywhere" this part is baroque and
    promises only a little. In practice two standard compliant
    Common Lisp implementatios running on the same system can
    produce different results from the same operations. So
    to use directory operations one have to be very careful to
    avoid nonportable parts.

    Technically Common Lisp does not have functions to create
    or remove directires, it can work only with existing ones.

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Lawrence D'Oliveiro on Wed May 21 19:51:25 2025
    On 5/20/25 23:37, Lawrence D'Oliveiro wrote:
    On Wed, 21 May 2025 10:23:27 +1000, Paul Edwards wrote:
    ...
    The key point about symlinks is they are not the same as hardlinks.

    There is no such universal concept for either of those things,

    Yes there is: they are defined in POSIX, which is an official standard,
    after all.

    It is a standard. It is not universal. On the Windows machines that I've
    used, tho closest equivalent to a symlink works significantly
    differently from a POSIX symlink.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Thu May 22 00:03:56 2025
    On Wed, 21 May 2025 19:50:33 +1000, Paul Edwards wrote:

    And MSDOS 4.0 - one of the systems I am interested in -
    is not "trying to become POSIX-like".

    Certainly MS-DOS added some Unix-like features beginning with version 2,
    if you remember. And later than that, Microsoft made more changes, like
    their C compiler stopped accepting default extensions and started using
    hyphens for its options.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jakob Bohm@21:1/5 to Paul Edwards on Thu May 22 02:20:36 2025
    On 2025-05-21 11:50, Paul Edwards wrote:
    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:100jhh4$2lgt3$3@dont-email.me...
    On Tue, 20 May 2025 22:26:57 -0400, James Kuyper wrote:

    There is a practical barrier - while C was developed in the context of
    Unix, which had a lot of influence on the design of C, that design has
    also always been motivated by a desire to, among other things, be as
    widely portable as possible.

    Furthermore, back in that day, some OSes (like MS-DOS) were pretty limited >> in their functionality, without even multi-tasking capability.

    And note that I sitll expect the proposed C90+ to support MSDOS.

    That situation has improved somewhat. Nowadays the world divides into
    POSIX-like versus non-POSIX-like. With the latter trying to become more
    POSIX-like over time.


    I'm not interested in restricting myself to "nowadays".

    That doesn't mean I want to add a "far" keyword though.
    Not that I would rule it out either.

    And MSDOS 4.0 - one of the systems I am interested in -
    is not "trying to become POSIX-like".

    [snip]


    MSDOS 2.0. tried to become more zzIX-like than MSDOS 1.x,
    specifically it added directories separated by some kind of
    slash. It also had a hidden option to choose between '/'
    for dirs '-' for options, or the MS-DOS 1.x style '/' for
    options with some unused char ('\\') for dirs.

    Later versions phased out that option and got stuck with
    the '\\' notation ever since.

    As for the directory API, MS-DOS went with an extended version
    of the MS-DOS 1.x API where each returned entry contained both
    the name and all other pertinent fields for a directory listing
    So essentially the equivalent of a POSIX readdir+stat but
    without the cost of a double directory lookup. So essentially,
    the readdir return structure was

    // This is a paraphrase, actual structure has different layout
    // and different field names
    struct _DIRENT {
    struct _stat st;
    char fn[FILENAME_MAX];
    };

    This is more efficient to use, and the MS-DOS file system at the
    time included the only copy of all the needed data in the place
    read by the readdir() implementation anyway. The later UNIX-like
    file system NTFS did not, so the file system driver would actively
    gather and cache the needed fields on the fly to preserve the API
    structure .

    Enjoy

    Jakob

    --
    Jakob Bohm, MSc.Eng., I speak only for myself, not my company
    This public discussion message is non-binding and may contain errors
    All trademarks and other things belong to their owners, if any.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Jakob Bohm on Thu May 22 02:53:42 2025
    On Thu, 22 May 2025 02:20:36 +0200, Jakob Bohm wrote:

    The later UNIX-like file system NTFS ...

    It was (and is) hard to describe NTFS as “Unix-like”. Yes, it had hierarchical directories and long(ish) file names, but not much else.
    Drive letters were inherited (indirectly) from DEC OSes, of all things,
    along with an insistence on having filename extensions, restrictions on characters allowed in names etc.

    Symlinks were not even added until Windows Vista. And you have to have
    special privileges to create them.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to James Kuyper on Thu May 22 05:04:44 2025
    On Wed, 21 May 2025 19:51:25 -0400, James Kuyper wrote:

    On 5/20/25 23:37, Lawrence D'Oliveiro wrote:

    On Wed, 21 May 2025 10:23:27 +1000, Paul Edwards wrote:
    ...
    The key point about symlinks is they are not the same as hardlinks.

    There is no such universal concept for either of those things,

    Yes there is: they are defined in POSIX, which is an official standard,
    after all.

    It is a standard. It is not universal. On the Windows machines that I've used, tho closest equivalent to a symlink works significantly
    differently from a POSIX symlink.

    So Microsoft didn’t add symlinks until Vista, and then screwed it up, as
    per usual.

    So what else is new?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Lawrence D'Oliveiro on Thu May 22 07:02:18 2025
    On 2025-05-22, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    Fun fact: even IBM mainframes run Linux now.

    One has to wonders where your head is buried ...

    Linux was running on S/390 systems before the 1990s were over.

    https://en.wikipedia.org/wiki/Linux_on_IBM_Z

    I saw a Linux users group presentation on this in 1999.

    --
    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 Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Thu May 22 06:49:15 2025
    On Wed, 21 May 2025 20:00:20 +1000, Paul Edwards wrote:

    An official standard that isn't even supported by Windows, which is far
    more important than any POSIX system in existence.

    It isn’t you know. Even Microsoft is now desperately trying to turn
    Windows into Linux. After decades conditioning their users to be allergic
    to the command line, suddenly they’re doing a full 180° and introducing a new command shell and new terminal into Windows ... not to mention a full- function Linux kernel on the side as well.

    Except z/OS obviously.

    Fun fact: even IBM mainframes run Linux now.

    But I'm not interested in the bolt-on z/OS Unix.

    Nobody is. It managed to pass the tests to license the “Unix” trademark, but nobody in their right mind would want to use it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Richard Heathfield on Thu May 22 06:37:38 2025
    On 5/21/25 11:37, Richard Heathfield wrote:
    ...
    I was hoping that Mr Edwards would be another such. I was (and
    remain) very ready to give him a fair crack at the whip, albeit
    not at the expense of people respected by people I respect, as it
    were. It seems that Mr Edwards may have come to us from a more
    combative environment where accusations of dishonesty are rife
    and hardly noticed; if so, it might take him a while to get used
    to a group where we generally treat such disrespectful tactics
    with contempt. Let us hope he learns quickly, before he ends up
    in too many killfiles.

    He's been in my killfile for a long time; long enough that I don't
    remember when or why. I only see his messages when quoted in other
    people's responses. Nothing I've seen from him in this thread has
    motivated me to remove him from my killfile.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Lawrence D'Oliveiro on Thu May 22 14:13:53 2025
    On 5/22/25 01:04, Lawrence D'Oliveiro wrote:
    On Wed, 21 May 2025 19:51:25 -0400, James Kuyper wrote:

    On 5/20/25 23:37, Lawrence D'Oliveiro wrote:

    On Wed, 21 May 2025 10:23:27 +1000, Paul Edwards wrote:
    ...
    The key point about symlinks is they are not the same as hardlinks.

    There is no such universal concept for either of those things,

    Yes there is: they are defined in POSIX, which is an official standard,
    after all.

    It is a standard. It is not universal. On the Windows machines that I've
    used, tho closest equivalent to a symlink works significantly
    differently from a POSIX symlink.

    So Microsoft didn’t add symlinks until Vista, and then screwed it up, as per usual.

    So what else is new?

    Nothing in particular. POSIX wasn't universal when C90 came out, and it
    still isn't universal today. Nothing new, just old news that hasn't chagned.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to James Kuyper on Thu May 22 17:53:46 2025
    On 2025-05-22, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 5/21/25 11:37, Richard Heathfield wrote:
    ...
    I was hoping that Mr Edwards would be another such. I was (and
    remain) very ready to give him a fair crack at the whip, albeit
    not at the expense of people respected by people I respect, as it
    were. It seems that Mr Edwards may have come to us from a more
    combative environment where accusations of dishonesty are rife
    and hardly noticed; if so, it might take him a while to get used
    to a group where we generally treat such disrespectful tactics
    with contempt. Let us hope he learns quickly, before he ends up
    in too many killfiles.

    He's been in my killfile for a long time; long enough that I don't
    remember when or why. I only see his messages when quoted in other
    people's responses. Nothing I've seen from him in this thread has
    motivated me to remove him from my killfile.

    Shrug. I see Paul as one of the good guys, fighting the ...
    Well, I don't know about "good fight", but at least "nerd fight".

    A lot of us have some measure of nostalgia for bygone systems, and deal
    with that in our own ways.

    For instance, someone not involved in any tinkering with any actual old
    stuff (hardware or languages) may nevertheless manifest nostalgia by
    decrying everything and anything that is overcomplicated and bloated,
    keeping his or her program images small, yet highly functional.


    --
    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 Lawrence D'Oliveiro@21:1/5 to James Kuyper on Thu May 22 22:46:17 2025
    On Thu, 22 May 2025 14:13:53 -0400, James Kuyper wrote:

    POSIX wasn't universal when C90 came out, and it still isn't universal
    today.

    POSIX is very much universal today. The entire Internet runs on POSIX-
    based systems. You likely have one in your pocket or purse right now.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Lawrence D'Oliveiro on Thu May 22 19:07:48 2025
    On 5/22/25 18:46, Lawrence D'Oliveiro wrote:
    On Thu, 22 May 2025 14:13:53 -0400, James Kuyper wrote:

    POSIX wasn't universal when C90 came out, and it still isn't universal
    today.

    POSIX is very much universal today. The entire Internet runs on POSIX-
    based systems. You likely have one in your pocket or purse right now.

    POSIX systems are quite wide-spread today. That doesn't make them
    universal. In order to be universal, there must be no non-POSIX systems,
    and that is manifestly not the case. In particular, while there is
    support for POSIX subsystem for Windows, it does not fully conform with
    POSIX, and is not the default when using Windows. There's also systems
    with no operating system at all, many of which could (and some of which
    do) support a fully conforming implementation of C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to James Kuyper on Thu May 22 23:15:13 2025
    On 2025-05-22, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 5/22/25 18:46, Lawrence D'Oliveiro wrote:
    On Thu, 22 May 2025 14:13:53 -0400, James Kuyper wrote:

    POSIX wasn't universal when C90 came out, and it still isn't universal
    today.

    POSIX is very much universal today. The entire Internet runs on POSIX-
    based systems. You likely have one in your pocket or purse right now.

    POSIX systems are quite wide-spread today. That doesn't make them
    universal. In order to be universal, there must be no non-POSIX systems,
    and that is manifestly not the case. In particular, while there is
    support for POSIX subsystem for Windows, it does not fully conform with POSIX, and is not the default when using Windows. There's also systems
    with no operating system at all, many of which could (and some of which
    do) support a fully conforming implementation of C.

    POSIX is fairly decently supported on Windows by Cygwin.

    (Of course not the POSIX subsystem; that is just some abandonware that Microsoft perpetrated years ago to get a rubber stamp on some government contracts or something.)

    --
    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 James Kuyper@21:1/5 to Kaz Kylheku on Thu May 22 20:10:17 2025
    On 5/22/25 19:15, Kaz Kylheku wrote:
    ...
    POSIX is fairly decently supported on Windows by Cygwin.

    Ignoring for the moment the different between "fairly decently" and
    "fully, Does everyone who uses Windows do so, 100% of the time, through
    Cygwin? I believe not - so POSIX is not in universal use.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Paul Edwards on Fri May 23 00:44:27 2025
    On 2025-05-22, Paul Edwards <mutazilah@gmail.com> wrote:
    "Kaz Kylheku" <643-408-1753@kylheku.com> wrote in message news:20250522161342.990@kylheku.com...

    On 2025-05-22, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 5/22/25 18:46, Lawrence D'Oliveiro wrote:
    On Thu, 22 May 2025 14:13:53 -0400, James Kuyper wrote:

    POSIX wasn't universal when C90 came out, and it still isn't universal >> >>> today.

    POSIX is very much universal today. The entire Internet runs on POSIX-
    based systems. You likely have one in your pocket or purse right now.

    POSIX systems are quite wide-spread today. That doesn't make them
    universal. In order to be universal, there must be no non-POSIX systems, >> > and that is manifestly not the case. In particular, while there is
    support for POSIX subsystem for Windows, it does not fully conform with
    POSIX, and is not the default when using Windows. There's also systems
    with no operating system at all, many of which could (and some of which
    do) support a fully conforming implementation of C.

    POSIX is fairly decently supported on Windows by Cygwin.

    You can add anything to anything.

    You may as well say that Windows is widely supported, via WINE.

    In fact, WINE is jokingly known as the only stable system API on Linux.

    I've made multiple attempts to install WINE. Only one of them,
    years ago, worked. Yes, with enough work, I could likely have
    got it to work.

    I think, just use a distro where you just install it as a package?

    Anyway, regarding Cygwin, I've never had problem getting that to
    install on a Windows box.

    I have a small project which is a fork of the Cygwin DLL,
    which I call "Cygnal" (the project, not the DLL).

    I use Cygwin's DLL as a run-time library for C programs on Windows,
    which lets them use Windows as well as POSIX features.

    However, Cygwin introduces certain translations in various
    which make the environment look *too* POSIXy. I patched those
    areas.

    For instance, paths can have drivce letter names under the Cygnal
    version of cygwin1.dll, like "c:/Program Files".

    The POSIX function chdir() understands the "logged drive" DOS/Windows
    concept. It associates drive letters with individual current
    working directories, and all the path access, so that
    open("e:foo.txt", O_RDWR) will open e:\path\to\foo.txt if
    the cwd of e: is \path\to.

    If you use system(), the interpreter is cmd.exe; whereas
    the stock DLL will look for /bin/sh that doesn't exist
    when you're just shipping a program DLLs.

    Cygwin's PATH is colon-delimited, so it translates the Windows one. I
    made it use the original semicolon delimited one.

    Things like that.

    POSIX is not universal. Not then. Not now. Unless you want
    to DEFINE it that way. ie any non-POSIX machine "doesn't
    count".

    C90 also isn't universal. the fetch-decode-execute dcycle.

    Alan Perlis Epigram 44:

    "Sometimes I think the only universal in the computing field is the fetch-execute cycle."

    --
    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 Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Fri May 23 01:18:04 2025
    On Fri, 23 May 2025 07:52:27 +1000, Paul Edwards wrote:

    Moreover, what is the definition of 'character' in this context?

    Something that fgetc() would be able to consume without blocking.

    That wouldn’t cope with Unicode. Anything that can’t cope with Unicode isn’t going to be considered very useful nowadays.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Waldek Hebisch on Fri May 23 01:17:19 2025
    On Wed, 21 May 2025 21:19:50 -0000 (UTC), Waldek Hebisch wrote:

    Common Lisp standard which is from similar period as C includes
    directory manipulation. In modern times this is considered one of
    least useful part of the language: to run "everywhere" this part is
    baroque and promises only a little.

    Unfortunately all too common in those days.

    And the Algol 68 standard, from the previous decade, was if anything even worse.

    Nowadays we just assume some minimally POSIX-compliant behaviour, and that keeps things nice and simple. As for platforms that can’t manage even
    that ... too bad.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to James Kuyper on Fri May 23 02:08:49 2025
    On 2025-05-23, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 5/22/25 19:15, Kaz Kylheku wrote:
    ...
    POSIX is fairly decently supported on Windows by Cygwin.

    Ignoring for the moment the different between "fairly decently" and
    "fully, Does everyone who uses Windows do so, 100% of the time, through Cygwin? I believe not - so POSIX is not in universal use.

    It doesn't matter because you can ship the POSIX run-time with
    your solution; you don't have to rely on Windows having that
    pre-installed.

    POSIX is a kind of language: C language extension libraries as well as
    some utilities built on them. (The utilities are not always of interest
    in the context of a C program being ported to a platform via POSIX.)

    No computer speaks POSIX natively; something must be installed.

    It's just another language run-time.

    Some systems integrate the POSIX run time; they are built around
    it from ground up. Some systems need an extran run-time for it.

    Windows doens't come with Java either; that doesn't prevent Java
    application delivery targeting Windows.

    Speaking of which, I have better application delivery than Java on
    Windows than with Cygwin-based libraries. It's just .exe and .dll
    files: native Windows stuff, self-contained in its own installation
    directory.

    Java programs usually ask users to install Java first, which is ugly and unprofessional. (Write once, nag everywhere?)

    --
    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 Kaz Kylheku@21:1/5 to Keith Thompson on Fri May 23 02:19:13 2025
    On 2025-05-23, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message
    news:87a575zvmb.fsf@nosuchdomain.example.com...

    I can't think of any other way to control an ASCII/EBCDIC
    ANSI X3.64 terminal without language/library support.

    But there's no such thing. I recall looking into this last time we
    discussed this, and ANSI X3.64 is defined in terms of ASCII.

    I didn't fully answer this either.

    Yes, if you want to be pedantic, the ANSI X3.64 uses the
    word ASCII, because they didn't spend any effort considering
    that someone might want to do exactly the same thing on an
    EBCDIC system - in the future - because there was no such
    thing in existence at that time.

    But if that committee had spent the effort to consider EBCDIC,
    they probably would have reworded the language.

    I believe that is unfounded speculation. I'm nearly certain that
    the designers of ANSI X3.64 were aware of EBCDIC. We know that
    they wrote a standard that depends on ASCII and not on EBCDIC.
    I presume this was an entirely deliberate choice, not an unfortunate oversight that they would have reconsidered if they had only taken
    a moment to think about it.

    ANSI X3.64 an adopted an existing standard called ECMA-48. The ECMA-48
    people probably based on ASCII because it was a continuation in a series
    of ECMA standards in the area of character sets. Before that they
    produced ECMA-6, related to ASCII, which went on to become ISO 646.

    Why would their terminal control standard cater to a character
    set unrelated to one they had invented, right?

    From their point of view, EBCDIC would likely have appeared as a
    nonstandard, vendor-specific character coding method, off-topic to their character set standardization efforts.

    --
    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 Kaz Kylheku@21:1/5 to Paul Edwards on Fri May 23 02:28:38 2025
    On 2025-05-22, Paul Edwards <mutazilah@gmail.com> wrote:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message
    I have now been given two pointers. Common Lisp,
    and C++ 17. Do you have any comment based on
    your knowledge of those?

    You've been given at least three; you didn't mention POSIX.

    No. That's not a language standard. Only in Common Lisp
    and C++ 17, so far mentioned, has the actual language
    standard - rightly or wrongly - another outstanding question -
    was it right or not? - covered directories.

    POSIX is a language extension; it extends the Library clause of ISO C
    with a myriad of new header files, functions, types and macros.

    We can meaningfully talk about a language called "POSIX C",
    distinct from ISO C due to (1) a richer Library clause and (2)
    certain requirements in POSIX which override certain implementation
    liberties in ISO C. E.g. I (may be wrong but I) think that POSIX doesn't
    allow int to be 16 bits wide. In other words, POSIX actually has
    some language-level requirements in regard to C.

    Library and Language are inseparable.

    In the case of above-mentioned Common Lisp, you can't even tell them
    apart. Nothing is built into the language other than a small set of
    special forms; the hundreds of other symbols can all be regared as
    library material: defun for defining functions is a macro, and hence a
    library feature. Basic mathematic operators like + are all functions,
    and so library features.

    --
    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 Janis Papanagnou@21:1/5 to Paul Edwards on Fri May 23 07:08:29 2025
    On 23.05.2025 01:16, Paul Edwards wrote:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87bjrkxonr.fsf@nosuchdomain.example.com...
    [...]

    If you're going to stick with existing C90 compilers, it seems
    to me that all you need for your purposes is an add-on library.

    This is (still) the [first] key observation, IMO.

    (And the second at the end of the post.)

    Here's the first disconnect.

    Yes - I already have an add-on library - that's the folder.c and
    folder.h I referenced in the beginning. And unistd.h would be
    another.

    But neither of these are in C23. Nor were they in C90.
    I want a slight variation to BOTH of those standards,
    and for the next ISO standard - C30 or whatever -
    to include that slight variation.

    You asked for suggestions and opinions. - And I suggest not to
    strive towards that (primary?) goal as your next step.

    I suggest to try a more modest approach, instead.

    See for example how things went into other languages' evolution;
    for example how STL or Booch functions entered C++. And also note
    Stepanow's long and broad experiences on such a library that went
    into STL before it got part of [later versions of] C++.

    Can you say the same of your project? - It would certainly be
    helpful.

    [...]

    All your talk of defining
    a new language based on C90 (whether you call it C90+, or C91,
    or whatever), as far as I can tell, is not useful.

    I apologize for not having the ability to express myself.
    I can only see in hindsight what the issues are.

    In this case, the plan is that my "add-on library", is so
    small, and so useful, and hopefully so popular, that it
    gets standardized into a theoretical C30,

    That all is not upon you who decides it. But you mentioned a
    crucial keyword here; "popular".

    If you have created a separate library, advertise it so that it
    gets used, and if people are widely happy to have that library
    suggest it for inclusion. Then committees might pick it up (or
    not).

    as well as
    existing C90 libraries - including but not limited to
    PDPCLIB - updated to include this new feature, that,
    in hindsight, should have existed even in K&R C.

    Your opinion on that is fine. There may even be more people
    sharing that opinion.

    [...] You don't
    want to change the core language (Section 6 of the standard).
    You don't need to change the standard library (Section 7); [...]

    Janis

    [...]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Keith Thompson on Fri May 23 07:43:30 2025
    On 23.05.2025 07:20, Keith Thompson wrote:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    [...]
    If you have created a separate library, advertise it so that it
    gets used, and if people are widely happy to have that library
    suggest it for inclusion. Then committees might pick it up (or
    not).

    Or it might *not* be included in the language standard because
    there's no need to do so. If a library is popular, programmers
    can just use it whether it's part of the standard library or not.
    Plenty of popular libraries are not part of the C standard library --
    and they don't need to be.

    Yes, sure. - I thought this was what I wrote [with other words];
    "might pick it up (or not)".

    Honestly, I still don't understand Paul's fixation on the standards
    track; i.e. beyond the good feeling one may have when contributing
    something [potentially] useful. If it's a sophisticated library and
    made available to the public that could be reward enough. (But who
    am I to judge. To each his own.)

    Janis

    [...]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Richard Heathfield on Fri May 23 05:43:34 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 20/05/2025 10:18, Keith Thompson wrote:

    C90 will never be extended.

    And for that reason it will always be valuable. Stability
    has a value all its own.

    C99 is just as stable as C90, and has been for well over a
    decade.

    C11 is just as stable as C90, and has been for just slightly
    less than a decade.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Tim Rentsch on Fri May 23 14:27:11 2025
    On 23/05/2025 13:43, Tim Rentsch wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 20/05/2025 10:18, Keith Thompson wrote:

    C90 will never be extended.

    And for that reason it will always be valuable. Stability
    has a value all its own.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Sure, but it's a different stable.

    If it were the same stable, it would be C90.

    C99 isn't C90, therefore it isn't the same stable.

    If you tell me C99 is a rock, I will not doubt you. But the C90
    rock it most certainly isn't.

    --
    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 Richard Harnden@21:1/5 to Keith Thompson on Fri May 23 16:09:32 2025
    On 22/05/2025 23:32, Keith Thompson wrote:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]

    In one of your library's headers:

    extern const char ESCAPE;

    In the corresponding *.c file:

    const char ESCAPE = ('z' - 'a' == 25 ? '\x1b' : '\x27');

    Change the name if you prefer.

    Wouldn't that be a reserved identifier?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Richard Harnden on Fri May 23 17:50:49 2025
    On 23/05/2025 16:09, Richard Harnden wrote:
    On 22/05/2025 23:32, Keith Thompson wrote:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]

    In one of your library's headers:

    extern const char ESCAPE;

    In the corresponding *.c file:

    const char ESCAPE = ('z' - 'a' == 25 ? '\x1b' : '\x27');

    Change the name if you prefer.

    Wouldn't that be a reserved identifier?

    7.26.3 (in 9899:1999) reads: 'Macros that begin with E and a
    digit or E and an uppercase letter may be added to the
    declarations in the <errno.h> header.'

    I can find no reference to such identifiers being explicitly
    reserved (did I miss something?), but the above at least hints at
    a potential clash between declaring ESCAPE and including the
    <errno.h> header.

    --
    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 Richard Heathfield on Fri May 23 16:57:23 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 23/05/2025 16:09, Richard Harnden wrote:
    On 22/05/2025 23:32, Keith Thompson wrote:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]

    In one of your library's headers:

    extern const char ESCAPE;

    In the corresponding *.c file:

    const char ESCAPE = ('z' - 'a' == 25 ? '\x1b' : '\x27');

    Change the name if you prefer.

    Wouldn't that be a reserved identifier?

    7.26.3 (in 9899:1999) reads: 'Macros that begin with E and a
    digit or E and an uppercase letter may be added to the
    declarations in the <errno.h> header.'

    I can find no reference to such identifiers being explicitly
    reserved (did I miss something?), but the above at least hints at
    a potential clash between declaring ESCAPE and including the
    <errno.h> header.

    ESCAPE isn't an uncommon macro.

    $ find . -type f -name '*.[chyl]' -print | xargs grep -w ESCAPE | grep define ./usr/src/common/X11R5/fonts/lib/font/Type1/type1.c:#define ESCAPE 12 ./usr/src/common/cmd/ksh/include/sym.h:#define ESCAPE '\\' ./usr/src/common/cmd/vi/port/ex.h:#define ESCAPE 033 ./usr/src/common/cmd/sh/sym.h:#define ESCAPE '\\' ./usr/src/common/lib/libadm/pkgparam.c:#define ESCAPE '\\'

    I think it would be unlikely for the C committe or POSIX/TOG
    to add ESCAPE to errno.h.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Scott Lurndal on Fri May 23 18:00:23 2025
    On 23/05/2025 17:57, Scott Lurndal wrote:
    I think it would be unlikely for the C committe or POSIX/TOG
    to add ESCAPE to errno.h.

    No doubt.

    Nevertheless, if they DO, we can't claim that they didn't give us
    fair warning.


    --
    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 Kaz Kylheku@21:1/5 to Richard Heathfield on Fri May 23 17:22:44 2025
    On 2025-05-23, Richard Heathfield <rjh@cpax.org.uk> wrote:
    On 23/05/2025 16:09, Richard Harnden wrote:
    On 22/05/2025 23:32, Keith Thompson wrote:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]

    In one of your library's headers:

    extern const char ESCAPE;

    In the corresponding *.c file:

    const char ESCAPE = ('z' - 'a' == 25 ? '\x1b' : '\x27');

    Change the name if you prefer.

    Wouldn't that be a reserved identifier?

    7.26.3 (in 9899:1999) reads: 'Macros that begin with E and a
    digit or E and an uppercase letter may be added to the
    declarations in the <errno.h> header.'

    Standardization has often introduced identifers that were not in any
    previously announced namespaces.

    If the spec said, "in the future, we may add any identifier of any kind
    to any header, beginning with any letter (upper or lower case)
    or underscore", I wouldn't stop programming.

    Name clashes are like moles in the whack-a-mole game. Whack them when
    they rear their heads.

    --
    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 Kaz Kylheku@21:1/5 to Keith Thompson on Fri May 23 20:27:37 2025
    On 2025-05-23, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    Richard Harnden <richard.harnden@gmail.invalid> writes:
    On 22/05/2025 23:32, Keith Thompson wrote:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]
    In one of your library's headers:
    extern const char ESCAPE;
    In the corresponding *.c file:
    const char ESCAPE = ('z' - 'a' == 25 ? '\x1b' : '\x27');
    Change the name if you prefer.

    Wouldn't that be a reserved identifier?

    Yes, it would. Good catch.

    (Identifiers starting with E followed by either a digit or an uppercase letter are reserved; they could be defined as macros in <errno.h>.)

    But C99 introduced, for instance "double round(double);".

    If you had programs which used that as a file scope identifier
    where <float.h> was included, or an external name, you had a clash.

    It wasn't previously announced that common mathematical words are
    reserved, or that identifiers starting with "r" are reserved.

    Basically, the concept of reserved spaces is not worth a damn, because
    ISO C doesn't actually confine itself to them when naming new entities,
    and so no matter what name you choose, you could have a clash in the
    future.

    There is no way to estimate whether some specific name starting with E
    is more or less likely to experience a clash than any other hame;
    i.e. we cannot say with certainty that ESCAPE is more likely to
    clash than MY_ESCAPE.

    Ironically, one way to protect yourself, at least as a solo developer
    working on a greenfield projecg with no third party cruft, is to use
    short identifiers like extern const char ES. Because no standard or
    major API is going to use short names. Everyone uses long-ish names
    because it's insane to do otherwise. And that gives YOU the room
    to do the insane thing. :)

    --
    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 Richard Heathfield@21:1/5 to Kaz Kylheku on Fri May 23 21:35:50 2025
    On 23/05/2025 21:27, Kaz Kylheku wrote:
    On 2025-05-23, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    <snip>

    (Identifiers starting with E followed by either a digit or an uppercase
    letter are reserved; they could be defined as macros in <errno.h>.)

    But C99 introduced, for instance "double round(double);"

    I am tempted to ask 'who cares?' but I will sit on my hands and
    be good.

    --
    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 Kaz Kylheku@21:1/5 to Richard Heathfield on Fri May 23 21:10:33 2025
    On 2025-05-23, Richard Heathfield <rjh@cpax.org.uk> wrote:
    On 23/05/2025 21:27, Kaz Kylheku wrote:
    On 2025-05-23, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    <snip>

    (Identifiers starting with E followed by either a digit or an uppercase
    letter are reserved; they could be defined as macros in <errno.h>.)

    But C99 introduced, for instance "double round(double);"

    I am tempted to ask 'who cares?' but I will sit on my hands and
    be good.

    That's essentially what I'm saying. Who cares about the silly reserved
    name spaces that provide nothing you can rely on to thwart future name
    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 Scott Lurndal@21:1/5 to Kaz Kylheku on Fri May 23 21:10:21 2025
    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    On 2025-05-23, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    Richard Harnden <richard.harnden@gmail.invalid> writes:
    On 22/05/2025 23:32, Keith Thompson wrote:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]
    In one of your library's headers:
    extern const char ESCAPE;
    In the corresponding *.c file:
    const char ESCAPE = ('z' - 'a' == 25 ? '\x1b' : '\x27');
    Change the name if you prefer.

    Wouldn't that be a reserved identifier?

    Yes, it would. Good catch.

    (Identifiers starting with E followed by either a digit or an uppercase
    letter are reserved; they could be defined as macros in <errno.h>.)

    But C99 introduced, for instance "double round(double);".

    If you had programs which used that as a file scope identifier
    where <float.h> was included, or an external name, you had a clash.

    It wasn't previously announced that common mathematical words are
    reserved, or that identifiers starting with "r" are reserved.

    Basically, the concept of reserved spaces is not worth a damn, because
    ISO C doesn't actually confine itself to them when naming new entities,
    and so no matter what name you choose, you could have a clash in the
    future.

    There is no way to estimate whether some specific name starting with E
    is more or less likely to experience a clash than any other hame;
    i.e. we cannot say with certainty that ESCAPE is more likely to
    clash than MY_ESCAPE.

    Ironically, one way to protect yourself, at least as a solo developer
    working on a greenfield projecg with no third party cruft, is to use
    short identifiers like extern const char ES. Because no standard or
    major API is going to use short names. Everyone uses long-ish names
    because it's insane to do otherwise. And that gives YOU the room
    to do the insane thing. :)

    Along with a couple dozen other new floating point functions. All
    of which are defined in <math.h>. The only potential conflict in
    code written prior to C99 would be applications that include <math.h>
    and defined their own 'round' function.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Kaz Kylheku on Fri May 23 23:13:20 2025
    On 23/05/2025 22:10, Kaz Kylheku wrote:
    On 2025-05-23, Richard Heathfield <rjh@cpax.org.uk> wrote:
    On 23/05/2025 21:27, Kaz Kylheku wrote:
    On 2025-05-23, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

    <snip>

    (Identifiers starting with E followed by either a digit or an uppercase >>>> letter are reserved; they could be defined as macros in <errno.h>.)

    But C99 introduced, for instance "double round(double);"

    I am tempted to ask 'who cares?' but I will sit on my hands and
    be good.

    That's essentially what I'm saying.

    But we refuse to care for different reasons, it seems.

    Who cares about the silly reserved
    name spaces that provide nothing you can rely on to thwart future name clashes.

    And who cares about future instability if C90 remains just as
    stable as ever it was? (If care there is, it's caring that
    implementors continue to include C90 implementations in their
    repertoire.)

    --
    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 Kaz Kylheku@21:1/5 to Scott Lurndal on Fri May 23 21:31:40 2025
    On 2025-05-23, Scott Lurndal <scott@slp53.sl.home> wrote:
    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    On 2025-05-23, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    Richard Harnden <richard.harnden@gmail.invalid> writes:
    On 22/05/2025 23:32, Keith Thompson wrote:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]
    In one of your library's headers:
    extern const char ESCAPE;
    In the corresponding *.c file:
    const char ESCAPE = ('z' - 'a' == 25 ? '\x1b' : '\x27');
    Change the name if you prefer.

    Wouldn't that be a reserved identifier?

    Yes, it would. Good catch.

    (Identifiers starting with E followed by either a digit or an uppercase
    letter are reserved; they could be defined as macros in <errno.h>.)

    But C99 introduced, for instance "double round(double);".

    If you had programs which used that as a file scope identifier
    where <float.h> was included, or an external name, you had a clash.

    [ ...]

    Along with a couple dozen other new floating point functions. All
    of which are defined in <math.h>. The only potential conflict in
    code written prior to C99 would be applications that include <math.h>
    and defined their own 'round' function.

    1. What are the odds that a program which defines its own round function
    might also include <math.h>?

    2. round is not only something declared in a header, but a name with
    external linkage which may have only one definition. If you're able
    to define round as an external name in your program, that's not due
    to a requirement coming from ISO C.

    3. Even if you're able to override the platform's external names in
    your program, you will not get away with that in a large project
    with third party dependencies. As soon as something wants to
    call the C99 round functon or the POSIX stat function,
    your clashing external definition for round or stat becomes
    a problem. You can really only gat away with "external name
    squatting" in solo projects with no dependencies, or projects of a
    similar nature and scope.

    --
    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 Kaz Kylheku@21:1/5 to James Kuyper on Sat May 24 00:08:32 2025
    On 2025-05-23, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 5/22/25 22:08, Kaz Kylheku wrote:
    On 2025-05-23, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 5/22/25 19:15, Kaz Kylheku wrote:
    ...
    POSIX is fairly decently supported on Windows by Cygwin.

    Ignoring for the moment the different between "fairly decently" and
    "fully, Does everyone who uses Windows do so, 100% of the time, through
    Cygwin? I believe not - so POSIX is not in universal use.
    ...
    No computer speaks POSIX natively; something must be installed.

    Yes, and POSIX could not be properly referred to as "Universal" unless
    it was universally installed - which it isn't. I can't believe that this point is being debated.

    The point requires no debate if we are talking about the POSIX
    environment, where if someone has such a thing, we can give them a
    #!/bin/sh script that will work in that environment. (And conversely,
    if they don't have such an environment, the script is of no use).

    The POSIX run-time for C programs is not in the same category.
    We can make programs which carry such a thing as their bundled
    run-time, and transparently use it. The user doesn't see any
    POSIX; just a program running on their host platform.

    It's the same why we don't care that malloc or printf are not universal.
    If we have a way to write hosted C for a platform and deliver programs,
    that delivery mechanism will somehow ensure that malloc and printf are
    there for our program, without the user having to install anything from
    a third party.

    --
    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 James Kuyper@21:1/5 to Kaz Kylheku on Fri May 23 19:29:41 2025
    On 5/22/25 22:08, Kaz Kylheku wrote:
    On 2025-05-23, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 5/22/25 19:15, Kaz Kylheku wrote:
    ...
    POSIX is fairly decently supported on Windows by Cygwin.

    Ignoring for the moment the different between "fairly decently" and
    "fully, Does everyone who uses Windows do so, 100% of the time, through
    Cygwin? I believe not - so POSIX is not in universal use.
    ...
    No computer speaks POSIX natively; something must be installed.

    Yes, and POSIX could not be properly referred to as "Universal" unless
    it was universally installed - which it isn't. I can't believe that this
    point is being debated.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Sat May 24 02:26:10 2025
    On Fri, 23 May 2025 09:26:47 +1000, Paul Edwards wrote:

    I've made multiple attempts to install WINE. Only one of them,
    years ago, worked. Yes, with enough work, I could likely have
    got it to work.

    Or you could pay money to someone with the smarts to do it properly.

    Look at Valve’s Steam Deck, for example: it uses WINE (actually Proton,
    which is built on top of WINE) to run a large enough chunk of Windows-
    specific games to be a successful commercial product.

    SteamOS is actually built on Arch Linux, of all things -- you know the
    geek meme “by the way, I use Arch”? Yes, *that* Arch. Are the Steam Deck buyers geeks? Of course not -- they’re the complete opposite, just
    ordinary folk who want to run their favourite games, nothing more. They
    want an appliance that you can just switch on and go, without having to
    fiddle about.

    Not something you can really say about Windows, is it ... ?

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

    Richard Harnden <richard.harnden@gmail.invalid> writes:

    On 22/05/2025 23:32, Keith Thompson wrote:

    "Paul Edwards" <mutazilah@gmail.com> writes:

    [...]

    In one of your library's headers:
    extern const char ESCAPE;
    In the corresponding *.c file:
    const char ESCAPE = ('z' - 'a' == 25 ? '\x1b' : '\x27');
    Change the name if you prefer.

    Wouldn't that be a reserved identifier?

    Yes, it would. Good catch.

    (Identifiers starting with E followed by either a digit or an uppercase letter are reserved; they could be defined as macros in <errno.h>.)

    They are reserved only as macros, and only if <errno.h> has
    been #include'd.

    For this particular use, it's easy to make the definition work,
    simply by adding

    #undef ESCAPE

    before the declaration in the header file, and before the
    definition in the source file (assuming of course that if
    there are any #include <errno.h> they precede the #undef's).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Richard Heathfield on Fri May 23 22:32:40 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 23/05/2025 13:43, Tim Rentsch wrote:

    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 20/05/2025 10:18, Keith Thompson wrote:

    C90 will never be extended.

    And for that reason it will always be valuable. Stability
    has a value all its own.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Sure, but it's a different stable.

    If it were the same stable, it would be C90.

    C99 isn't C90, therefore it isn't the same stable.

    If you tell me C99 is a rock, I will not doubt you. But the C90 rock
    it most certainly isn't.

    Now you're being silly. The adjective "stable" means "unchanging".
    C99 and C11 are just as unchanging as C90, and so just as stable.

    If you want to say C90 has some other quality that C99 or C11
    doesn't, by all means do so. But don't play word games or distort
    the English language in an effort to make C90 something it isn't.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Richard Heathfield on Fri May 23 22:22:58 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 23/05/2025 22:10, Kaz Kylheku wrote:

    On 2025-05-23, Richard Heathfield <rjh@cpax.org.uk> wrote:

    On 23/05/2025 21:27, Kaz Kylheku wrote:

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

    <snip>

    (Identifiers starting with E followed by either a digit or an uppercase >>>>> letter are reserved; they could be defined as macros in <errno.h>.)

    But C99 introduced, for instance "double round(double);"

    I am tempted to ask 'who cares?' but I will sit on my hands and
    be good.

    That's essentially what I'm saying.

    But we refuse to care for different reasons, it seems.

    Who cares about the silly reserved
    name spaces that provide nothing you can rely on to thwart future name
    clashes.

    And who cares about future instability if C90 remains just as stable
    as ever it was? (If care there is, it's caring that implementors
    continue to include C90 implementations in their repertoire.)

    There's a catch though to that "future instability" matter. Some
    sets of names described in library headers, such as the ESCAPE
    example of this thread, are reserved and allowed to change even
    in a conforming C90 implementation. A seemingly innocuous line
    of code such as

    int towel;

    could run afoul of this rule, even in a strictly C90 environment.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Tim Rentsch on Sat May 24 06:54:09 2025
    On 24/05/2025 06:32, Tim Rentsch wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 23/05/2025 13:43, Tim Rentsch wrote:

    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 20/05/2025 10:18, Keith Thompson wrote:

    C90 will never be extended.

    And for that reason it will always be valuable. Stability
    has a value all its own.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Sure, but it's a different stable.

    If it were the same stable, it would be C90.

    C99 isn't C90, therefore it isn't the same stable.

    If you tell me C99 is a rock, I will not doubt you. But the C90 rock
    it most certainly isn't.

    Now you're being silly.

    No, sir. If you want to play that game, you can play it with
    yourself. I know that you are perfectly capable of polite
    conversation, so I see no reason to endure the opposite.

    --
    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 Richard Heathfield@21:1/5 to Tim Rentsch on Sat May 24 06:46:02 2025
    On 24/05/2025 06:22, Tim Rentsch wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 23/05/2025 22:10, Kaz Kylheku wrote:

    On 2025-05-23, Richard Heathfield <rjh@cpax.org.uk> wrote:

    On 23/05/2025 21:27, Kaz Kylheku wrote:

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

    <snip>

    (Identifiers starting with E followed by either a digit or an uppercase >>>>>> letter are reserved; they could be defined as macros in <errno.h>.) >>>>>
    But C99 introduced, for instance "double round(double);"

    I am tempted to ask 'who cares?' but I will sit on my hands and
    be good.

    That's essentially what I'm saying.

    But we refuse to care for different reasons, it seems.

    Who cares about the silly reserved
    name spaces that provide nothing you can rely on to thwart future name
    clashes.

    And who cares about future instability if C90 remains just as stable
    as ever it was? (If care there is, it's caring that implementors
    continue to include C90 implementations in their repertoire.)

    There's a catch though to that "future instability" matter. Some
    sets of names described in library headers, such as the ESCAPE
    example of this thread, are reserved and allowed to change even
    in a conforming C90 implementation. A seemingly innocuous line
    of code such as

    int towel;

    could run afoul of this rule, even in a strictly C90 environment.

    Indeed, but 4.13 of ANSI C and 7.26 of ISO C document the rule
    clearly enough. Caveat nomen!


    --
    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 Paul Edwards on Sat May 24 22:10:59 2025
    "Paul Edwards" <mutazilah@gmail.com> writes:

    Someone (Jean-Marc) wrote some "folder" routines which I like a lot.
    You can see them here:

    https://sourceforge.net/p/pdos/gitcode/ci/master/tree/hwzip/folder.c

    And in essence, when you read from a directory, the only
    thing you get is the filename. If it is actually a subdirectory,
    then that is indicated with a "/" at the end of the filename.

    [elaboration]

    Any thoughts (besides "get a life!")?

    I offer the following items of advice, after reading many of
    the postings in this thread.

    Stop thinking about what is faithful to the spirit of C90.
    All that matters is whether you think a feature or language
    construct is consistent with what you think of as C90.
    Nothing else.

    If you want to describe a language change, or addition,
    write a description in the style of a section of the
    ISO C standard, from section 6 or before. (Personally I
    think the writing in C99 or C11 is a little better
    than the writing in C90, but make a choice about which
    one you prefer and stick to it.)

    If you want to describe additional library functionality,
    write a description in the style of a section of the ISO C
    standard, from section 7.

    Learn how to write more clearly, more concisely, and more
    effectively in terms of communicating your thoughts to
    others. Write to convey, not to convince.

    Make all of the above your immediate priority, and nothing
    else, until descriptions of any and all new features and
    language constructs are complete.

    Don't give any feedback on the advice given here, whether you
    think it's good or it's bad or whatever. If you don't want to
    follow it, don't follow it; it makes no nevermind to me, nor I
    expect to anyone else. (And it is my request that no one else
    discuss it either, because doing so is worse than just a waste
    of time but actually counterproductive. This thread has gone
    on way too long already.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to Keith.S.Thompson+u@gmail.com on Sun May 25 23:25:06 2025
    In article <875xhojp5n.fsf@nosuchdomain.example.com>,
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]
    It never ever occurred to me that a US president would one
    day [SNIP]

    I urge you to stick to the topic of this newsgroup. If you want
    to talk about politics, don't do it here. And if you want to talk
    about coercing or bribing members of the C committee or any similar >antisocial behaviors, keep it to yourself.

    I can't stop you from posting here. I can ignore you.

    You should have done that long ago.

    It is clear that you and Paul are not even on the same planet in terms of
    what you are talking about. Whatever made you think you two could
    communicate?

    Really, Keith, you don't have to respond to every single thread. You don't have to assert your control and dominance in every single battle. Instead,
    you need to carefully pick the ones in which your particular brand of
    blather will be appreciated.

    --
    I'll give him credit for one thing: He is (& will be) the most quotable President
    ever. Books have been written about (GW) Bushisms, but Dubya's got nothing on Trump.

    Tremendously wet - from the standpoint of water.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Mon May 26 00:15:19 2025
    On Mon, 26 May 2025 09:48:46 +1000, Paul Edwards wrote:

    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:100oicc$3ob15$3@dont-email.me...

    On Fri, 23 May 2025 07:52:27 +1000, Paul Edwards wrote:

    Moreover, what is the definition of 'character' in this context?

    Something that fgetc() would be able to consume without blocking.

    That wouldn't cope with Unicode. Anything that can't cope with Unicode
    isn't going to be considered very useful nowadays.

    "people nowadays" don't speak with one voice.

    Nor with one language. Which is why we have Unicode.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Paul Edwards on Mon May 26 03:37:28 2025
    On 25.05.2025 23:54, Paul Edwards wrote:
    "Janis Papanagnou" <janis_papanagnou+ng@hotmail.com> wrote in message news:100p1u4$3um4p$1@dont-email.me...
    On 23.05.2025 07:20, Keith Thompson wrote:
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
    [...]
    If you have created a separate library, advertise it so that it
    gets used, and if people are widely happy to have that library
    suggest it for inclusion. Then committees might pick it up (or
    not).

    Or it might *not* be included in the language standard because
    there's no need to do so. If a library is popular, programmers
    can just use it whether it's part of the standard library or not.
    Plenty of popular libraries are not part of the C standard library --
    and they don't need to be.

    Yes, sure. - I thought this was what I wrote [with other words];
    "might pick it up (or not)".

    Honestly, I still don't understand Paul's fixation on the standards
    track; i.e. beyond the good feeling one may have when contributing
    something [potentially] useful. If it's a sophisticated library and
    made available to the public that could be reward enough. (But who
    am I to judge. To each his own.)

    (sorry for the delay in replying)

    No worries.

    [snip many lines]

    tldr;

    Your posts are many and always also very long, with repetitions, but
    rarely clarifying things [for me], they also appear incoherent to me.
    So bear with me if I now occasionally skip (some of your) long posts.
    If you have a clear desire I'd think it could be formulated tersely
    (or its content be reconsidered to gain more clarity before posting).

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Paul Edwards on Mon May 26 03:29:13 2025
    On 26.05.2025 00:40, Paul Edwards wrote:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87a570jpe6.fsf@nosuchdomain.example.com...

    You can just use '\x27' in your code. It doesn't
    have to be part of the language standard. If you have an application
    that, for whatever reason, needs to drive both ASCII and EBCDIC
    terminals, you can configure it by any means you like to use
    '\x1b' or '\x27` (command-line argument, environment variable,
    configuration file, reply from the terminal, whatever).

    Yes, I agree those are standards-conforming alternatives.

    But not what I want. For reasons which are difficult for me
    to elaborate - "aesthetic", or "self-contained" may or may
    not be apt words - I want to include the ESCAPE in the
    C code, just like the "hello, world\n" bit.

    Doesn't '\e' work for you?

    char * str = "\e";
    puts (str);

    printf ("\e\n");

    putchar ('\e');
    putchar ('\n');

    Works for me. - Is that non-standard?

    $ cc -std=c90 escape.c
    $ a.out | od -c
    0000000 033 \n 033 \n 033 \n


    The C90 committee didn't force me to accept "\n" from a
    config file, so that I could have CRLF on MSDOS.

    If what you want as "escape" is a semantical name also on your
    EBCDIC systems then I'd expect a compiler to use the correct
    encoding for '\e'.

    (If OTOH that "escape" isn't a general semantical term then it
    wouldn't be reflected by the compiler; you certainly cannot
    expect it be defined through a _configuration_ file.)

    Janis

    [...]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From vallor@21:1/5 to All on Mon May 26 04:05:25 2025
    XPost: comp.programming

    On Mon, 26 May 2025 08:40:50 +1000, "Paul Edwards" <mutazilah@gmail.com>
    wrote in <101069l$1k3nm$1@dont-email.me>:

    The idea that you can't do that without a constant defined in your
    language standard is just silly.

    It may be silly from your perspective, but for me it is crucial.

    I've x-posted this to comp.programming, and set followup-to there.

    I'm wondering why your control-character-handling wouldn't be better
    handled with a curses library. IIRC, back in my DOS days (early 90's),
    there was a curses library for DOS.

    A quick look around found this: https://pdcurses.org/ ...which
    includes DOS support.

    If it doesn't handle EBCDIC terminal escapes, consider extending it.

    I don't know anything about microemacs, but if it doesn't use a curses-like library to handle different terminal types, I'd be surprised. I see that Linus' uemacs uses curses:

    https://github.com/torvalds/uemacs/blob/master/tcap.c

    Again, followup-to comp.programming, as this is definitely off-topic
    for comp.lang.c.

    --
    -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti
    OS: Linux 6.14.8 Release: Mint 22.1 Mem: 258G
    "Conformity obstructs progress."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Janis Papanagnou on Mon May 26 09:43:07 2025
    On 5/25/25 21:29, Janis Papanagnou wrote:
    On 26.05.2025 00:40, Paul Edwards wrote:
    ...
    But not what I want. For reasons which are difficult for me
    to elaborate - "aesthetic", or "self-contained" may or may
    not be apt words - I want to include the ESCAPE in the
    C code, just like the "hello, world\n" bit.

    Doesn't '\e' work for you?

    char * str = "\e";
    puts (str);

    printf ("\e\n");

    putchar ('\e');
    putchar ('\n');

    Works for me. - Is that non-standard?

    Yes. It's a common extension.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to James Kuyper on Mon May 26 17:16:53 2025
    On 2025-05-26, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 5/25/25 21:29, Janis Papanagnou wrote:
    On 26.05.2025 00:40, Paul Edwards wrote:
    ...
    But not what I want. For reasons which are difficult for me
    to elaborate - "aesthetic", or "self-contained" may or may
    not be apt words - I want to include the ESCAPE in the
    C code, just like the "hello, world\n" bit.

    Doesn't '\e' work for you?

    char * str = "\e";
    puts (str);

    printf ("\e\n");

    putchar ('\e');
    putchar ('\n');

    Works for me. - Is that non-standard?

    Yes. It's a common extension.

    If that's not available in compilers for IBM mainframes in such a way
    that it produces the EBCDIC escape, then it doesn't solve Paul's
    "problem" anyway.

    --
    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 Peter 'Shaggy' Haywood@21:1/5 to All on Mon May 26 15:19:36 2025
    Groovy hepcat Tim Rentsch was jivin' in comp.lang.c on Fri, 23 May 2025
    10:43 pm. It's a cool scene! Dig it.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Methinks Tim is having trouble with his arithmetic. Either that or he
    doesn't know what year it is now. :)
    C99 was ratified in 1999, over two and a half decades ago.

    C11 is just as stable as C90, and has been for just slightly
    less than a decade.

    And C11 was ratified in 2011, no? That was almost a decade and a half
    ago.

    --


    ----- Dig the NEW and IMPROVED news sig!! -----


    -------------- Shaggy was here! ---------------
    Ain't I'm a dawg!!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Peter 'Shaggy' Haywood on Tue May 27 16:23:22 2025
    On 26/05/2025 07:19, Peter 'Shaggy' Haywood wrote:
    Groovy hepcat Tim Rentsch was jivin' in comp.lang.c on Fri, 23 May 2025
    10:43 pm. It's a cool scene! Dig it.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Methinks Tim is having trouble with his arithmetic. Either that or he doesn't know what year it is now. :)
    C99 was ratified in 1999, over two and a half decades ago.

    C11 is just as stable as C90, and has been for just slightly
    less than a decade.

    And C11 was ratified in 2011, no? That was almost a decade and a half
    ago.


    Tim was, I believe, taking into account the time it took for common implementations of C compilers and libraries to have complete and
    generally bug-free support for the standards, and for these
    implementations to become common. C99 was published in 1999, but it
    took quite a while before most people programming in C could happily use
    C99 without worrying about the tool support being "experimental" or not
    as mature as C90 support.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to David Brown on Tue May 27 18:10:41 2025
    On Tue, 27 May 2025 16:23:22 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    On 26/05/2025 07:19, Peter 'Shaggy' Haywood wrote:
    Groovy hepcat Tim Rentsch was jivin' in comp.lang.c on Fri, 23 May
    2025 10:43 pm. It's a cool scene! Dig it.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Methinks Tim is having trouble with his arithmetic. Either that
    or he doesn't know what year it is now. :)
    C99 was ratified in 1999, over two and a half decades ago.

    C11 is just as stable as C90, and has been for just slightly
    less than a decade.

    And C11 was ratified in 2011, no? That was almost a decade and a
    half ago.


    Tim was, I believe, taking into account the time it took for common implementations of C compilers and libraries to have complete and
    generally bug-free support for the standards, and for these
    implementations to become common. C99 was published in 1999, but it
    took quite a while before most people programming in C could happily
    use C99 without worrying about the tool support being "experimental"
    or not as mature as C90 support.



    I believe that your belief is wrong.
    It is much more likely that Tim took into account defect reports.
    Here is the list of C11 defect reports with the last dated 2016: https://open-std.org/jtc1/sc22/wg14/www/docs/summary.htm

    I did not find similar list for C99. However believing Tim I would guess
    that the last change in C99 document was made ~15 years ago.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Michael S on Tue May 27 19:24:45 2025
    On 27/05/2025 17:10, Michael S wrote:
    On Tue, 27 May 2025 16:23:22 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    On 26/05/2025 07:19, Peter 'Shaggy' Haywood wrote:
    Groovy hepcat Tim Rentsch was jivin' in comp.lang.c on Fri, 23 May
    2025 10:43 pm. It's a cool scene! Dig it.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Methinks Tim is having trouble with his arithmetic. Either that
    or he doesn't know what year it is now. :)
    C99 was ratified in 1999, over two and a half decades ago.

    C11 is just as stable as C90, and has been for just slightly
    less than a decade.

    And C11 was ratified in 2011, no? That was almost a decade and a
    half ago.


    Tim was, I believe, taking into account the time it took for common
    implementations of C compilers and libraries to have complete and
    generally bug-free support for the standards, and for these
    implementations to become common. C99 was published in 1999, but it
    took quite a while before most people programming in C could happily
    use C99 without worrying about the tool support being "experimental"
    or not as mature as C90 support.



    I believe that your belief is wrong.
    It is much more likely that Tim took into account defect reports.
    Here is the list of C11 defect reports with the last dated 2016: https://open-std.org/jtc1/sc22/wg14/www/docs/summary.htm

    I did not find similar list for C99. However believing Tim I would guess
    that the last change in C99 document was made ~15 years ago.


    That sounds like a more plausible explanation than mine. You could say
    that my suggestion is "stable in practice", while the defect reports are "stable in theory". I think "stable in practice" is of greater
    importance to most programmers, but I believe it would be more in
    character for Tim to emphasis "stable in theory". In either case, I
    think it is fair to say that C99 and C11 are both very stable versions
    of C, and by now are just as suitable choices as C90 for most (but not
    all) purposes.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Peter 'Shaggy' Haywood on Tue May 27 16:18:29 2025
    Peter 'Shaggy' Haywood <phaywood@alphalink.com.au> writes:

    Groovy hepcat Tim Rentsch was jivin' in comp.lang.c on Fri, 23 May 2025
    10:43 pm. It's a cool scene! Dig it.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Methinks Tim is having trouble with his arithmetic. Either that or he doesn't know what year it is now. :)
    C99 was ratified in 1999, over two and a half decades ago.

    C11 is just as stable as C90, and has been for just slightly
    less than a decade.

    And C11 was ratified in 2011, no? That was almost a decade and a half
    ago.

    Amusing that you have such a low opinion of my mental
    faculties. :)

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

    On Tue, 27 May 2025 16:23:22 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    On 26/05/2025 07:19, Peter 'Shaggy' Haywood wrote:

    Groovy hepcat Tim Rentsch was jivin' in comp.lang.c on Fri, 23 May
    2025 10:43 pm. It's a cool scene! Dig it.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Methinks Tim is having trouble with his arithmetic. Either that
    or he doesn't know what year it is now. :)
    C99 was ratified in 1999, over two and a half decades ago.

    C11 is just as stable as C90, and has been for just slightly
    less than a decade.

    And C11 was ratified in 2011, no? That was almost a decade and a
    half ago.

    Tim was, I believe, taking into account the time it took for common
    implementations of C compilers and libraries to have complete and
    generally bug-free support for the standards, and for these
    implementations to become common. C99 was published in 1999, but it
    took quite a while before most people programming in C could happily
    use C99 without worrying about the tool support being "experimental"
    or not as mature as C90 support.

    I believe that your belief is wrong.
    It is much more likely that Tim took into account defect reports.
    Here is the list of C11 defect reports with the last dated 2016: https://open-std.org/jtc1/sc22/wg14/www/docs/summary.htm

    I did not find similar list for C99. However believing Tim I would guess that the last change in C99 document was made ~15 years ago.

    You are partly right. Besides defect reports, there are TCs. And
    there is always the possibility of future TCs, future defect
    reports, or future changes for any ISO C standard while it is
    still current.

    To be as stable as C90, a C standard would need to be immune to
    the possibility of such future changes.

    I take C99 to have reached this level of stability in 2011, when
    it was superseded by C11. I take C11 to have reached this level
    of stability in 2017, when it was superseded by C17.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Richard Heathfield on Wed May 28 05:41:02 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 24/05/2025 06:32, Tim Rentsch wrote:

    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 23/05/2025 13:43, Tim Rentsch wrote:

    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 20/05/2025 10:18, Keith Thompson wrote:

    C90 will never be extended.

    And for that reason it will always be valuable. Stability
    has a value all its own.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Sure, but it's a different stable.

    If it were the same stable, it would be C90.

    C99 isn't C90, therefore it isn't the same stable.

    If you tell me C99 is a rock, I will not doubt you. But the C90
    rock it most certainly isn't.

    Now you're being silly.

    No, sir. If you want to play that game, you can play it with
    yourself. I know that you are perfectly capable of polite
    conversation, so I see no reason to endure the opposite.

    I don't think I'm being impolite. I think your comments
    were deliberately playing games with language, to make a
    point that has nothing to do with what I said. I don't
    think it's rude or even inconsiderate to point that out.
    If someone wants to say it could have been pointed out in
    a better way, okay, probably it could have been, but it
    wasn't meant as a personal comment, and I think that was
    evident from the rest of what I said (which was left out
    in your followup message).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Tim Rentsch on Wed May 28 14:10:47 2025
    On 28/05/2025 13:41, Tim Rentsch wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 24/05/2025 06:32, Tim Rentsch wrote:

    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 23/05/2025 13:43, Tim Rentsch wrote:

    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 20/05/2025 10:18, Keith Thompson wrote:

    C90 will never be extended.

    And for that reason it will always be valuable. Stability
    has a value all its own.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Sure, but it's a different stable.

    If it were the same stable, it would be C90.

    C99 isn't C90, therefore it isn't the same stable.

    If you tell me C99 is a rock, I will not doubt you. But the C90
    rock it most certainly isn't.

    Now you're being silly.

    No, sir. If you want to play that game, you can play it with
    yourself. I know that you are perfectly capable of polite
    conversation, so I see no reason to endure the opposite.

    I don't think I'm being impolite.

    Then we are again in disagreement, and it seems obvious that it
    would be foolishly optimistic of me to expect to be able to
    resolve the matter. I'll tell Thunderbird to leave it there.

    --
    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 Wed May 28 16:04:15 2025
    On Tue, 27 May 2025 16:16:50 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    Michael S <already5chosen@yahoo.com> writes:

    On Tue, 27 May 2025 16:23:22 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    On 26/05/2025 07:19, Peter 'Shaggy' Haywood wrote:

    Groovy hepcat Tim Rentsch was jivin' in comp.lang.c on Fri, 23 May
    2025 10:43 pm. It's a cool scene! Dig it.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Methinks Tim is having trouble with his arithmetic. Either
    that or he doesn't know what year it is now. :)
    C99 was ratified in 1999, over two and a half decades ago.

    C11 is just as stable as C90, and has been for just slightly
    less than a decade.

    And C11 was ratified in 2011, no? That was almost a decade
    and a half ago.

    Tim was, I believe, taking into account the time it took for common
    implementations of C compilers and libraries to have complete and
    generally bug-free support for the standards, and for these
    implementations to become common. C99 was published in 1999, but
    it took quite a while before most people programming in C could
    happily use C99 without worrying about the tool support being
    "experimental" or not as mature as C90 support.

    I believe that your belief is wrong.
    It is much more likely that Tim took into account defect reports.
    Here is the list of C11 defect reports with the last dated 2016: https://open-std.org/jtc1/sc22/wg14/www/docs/summary.htm

    I did not find similar list for C99. However believing Tim I would
    guess that the last change in C99 document was made ~15 years ago.

    You are partly right. Besides defect reports, there are TCs. And
    there is always the possibility of future TCs, future defect
    reports, or future changes for any ISO C standard while it is
    still current.

    To be as stable as C90, a C standard would need to be immune to
    the possibility of such future changes.

    I take C99 to have reached this level of stability in 2011, when
    it was superseded by C11. I take C11 to have reached this level
    of stability in 2017, when it was superseded by C17.

    Got it. Stability occurs when the standards is fenced from changes by
    presence of the next edition.
    Stability by obsolescence.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Michael S on Wed May 28 22:54:47 2025
    On 2025-05-28, Michael S <already5chosen@yahoo.com> wrote:
    Got it. Stability occurs when the standards is fenced from changes by presence of the next edition.

    Each technical corrigendum effectively yields a new edition.

    The previous standard without that corrigendum is forever stable,
    as any immutable object.

    --
    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 Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Thu May 29 07:26:02 2025
    On Mon, 26 May 2025 11:50:30 +1000, Paul Edwards wrote:

    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:1010bqn$1l25r$1@dont-email.me...

    On Mon, 26 May 2025 09:48:46 +1000, Paul Edwards wrote:

    "people nowadays" don't speak with one voice.

    Nor with one language. Which is why we have Unicode.

    Which is one solution to the problem.

    Just not a solution I agree with.

    It’s the one most of the nations of the world agree with.

    I prefer VISCII-like, possibly requiring a 9-bit char, and invalidating
    all applications with POSIX assumptions.

    Are you going to set up your own UN as well? You could call it the “World Series of Nations” ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Thu May 29 07:21:53 2025
    On Wed, 21 May 2025 19:23:45 +1000, Paul Edwards wrote:

    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:100j8t8$2g75r$5@dont-email.me...

    On Wed, 21 May 2025 07:41:12 +1000, Paul Edwards wrote:

    Basically the software industry is a joke. The advances have all been
    done by hardware engineers.

    Didn't they use software to manage that?

    Yes - as the guy (Jeff) said - software written by lunatics/artists.

    Was RCU invented by the hardware guys, or the software guys?

    What about journalling? Two-phase commit? Diffie-Hellman? RSA? Kerberos?
    kexec?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Richard Heathfield on Thu May 29 07:27:45 2025
    On Fri, 23 May 2025 23:13:20 +0100, Richard Heathfield wrote:

    And who cares about future instability if C90 remains just as stable as
    ever it was?

    Even with the problems with const?

    char *strstr(const char *haystack, const char *needle);

    Dennis Ritchie pointed out the trouble with that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Kaz Kylheku on Thu May 29 10:21:54 2025
    On 29/05/2025 00:54, Kaz Kylheku wrote:
    On 2025-05-28, Michael S <already5chosen@yahoo.com> wrote:
    Got it. Stability occurs when the standards is fenced from changes by
    presence of the next edition.

    Each technical corrigendum effectively yields a new edition.

    The previous standard without that corrigendum is forever stable,
    as any immutable object.


    They also tend to have a very small impact on the practical
    implementations of the standards. AFAIK the TC's have all been small
    changes to the wording of the standard to improve clarity, rather than
    changing the language as implemented by toolchains.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Lawrence D'Oliveiro on Thu May 29 09:39:51 2025
    On 29/05/2025 08:27, Lawrence D'Oliveiro wrote:
    On Fri, 23 May 2025 23:13:20 +0100, Richard Heathfield wrote:

    And who cares about future instability if C90 remains just as stable as
    ever it was?

    Even with the problems with const?

    char *strstr(const char *haystack, const char *needle);

    Dennis Ritchie pointed out the trouble with that.

    Is C90 perfect? No, of course not. "C is quirky, flawed, and an
    enormous success."

    Is there value in having a powerful, widely-available language
    that, when you turn your back for a moment, stays *exactly* where
    you left it? Hell, yes.

    --
    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 James Kuyper@21:1/5 to Lawrence D'Oliveiro on Thu May 29 06:11:17 2025
    On 5/29/25 05:37, Lawrence D'Oliveiro wrote:
    On Thu, 29 May 2025 09:39:51 +0100, Richard Heathfield wrote:
    ...
    Is C90 perfect? No, of course not.

    Is there some value in that particular state of imperfection? Like the
    Amish, whose concept of the ideal level of technology is the one that was
    in effect at the time they were founded? And who have remained stuck at
    that point in time ever since?

    That's not actually the case. The Amish have slowly adopted more
    advanced levels of technology as the people around them have adopted
    farm more advanced ones. The important thing, from their point of view,
    it not a particular level of technology, but to maintain a clear
    distinction between them and the non-Amish.
    Which means that they are more adaptable than Richard is.
    Also note that different groups of Amish have different attitudes about
    what the correct technology level is.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Richard Heathfield on Thu May 29 09:37:38 2025
    On Thu, 29 May 2025 09:39:51 +0100, Richard Heathfield wrote:

    On 29/05/2025 08:27, Lawrence D'Oliveiro wrote:

    On Fri, 23 May 2025 23:13:20 +0100, Richard Heathfield wrote:

    And who cares about future instability if C90 remains just as stable
    as ever it was?

    Even with the problems with const?

    char *strstr(const char *haystack, const char *needle);

    Dennis Ritchie pointed out the trouble with that.

    Is C90 perfect? No, of course not.

    Is there some value in that particular state of imperfection? Like the
    Amish, whose concept of the ideal level of technology is the one that was
    in effect at the time they were founded? And who have remained stuck at
    that point in time ever since?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Lawrence D'Oliveiro on Thu May 29 13:38:37 2025
    On 29/05/2025 10:37, Lawrence D'Oliveiro wrote:
    On Thu, 29 May 2025 09:39:51 +0100, Richard Heathfield wrote:

    On 29/05/2025 08:27, Lawrence D'Oliveiro wrote:

    On Fri, 23 May 2025 23:13:20 +0100, Richard Heathfield wrote:

    And who cares about future instability if C90 remains just as stable
    as ever it was?

    Even with the problems with const?

    char *strstr(const char *haystack, const char *needle);

    Dennis Ritchie pointed out the trouble with that.

    Is C90 perfect? No, of course not.

    Is there some value in that particular state of imperfection?

    Yes.

    Like the
    Amish, whose concept of the ideal level of technology is the one that was
    in effect at the time they were founded? And who have remained stuck at
    that point in time ever since?

    No, not even remotely like that.

    If I want C++, I know where to find it. If I want Python, I know
    where to find it. If I want Rust, I know where to find it.

    You can have new tools without breaking the old ones. We didn't
    have to change BCPL to get B, or B to get C, or C to get D or C++.

    This really is a very simple point, but perhaps a simple analogy
    will help to clarify it. You don't throw out your 3/4" just
    because you've bought a 19mm. There is room for both in the
    toolbox, and why write 3/4" on your new spanner? It /isn't/ a
    3/4" spanner even though it's very like it, so why pretend otherwise?

    --
    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 Richard Heathfield@21:1/5 to James Kuyper on Thu May 29 13:41:13 2025
    On 29/05/2025 11:11, James Kuyper wrote:
    On 5/29/25 05:37, Lawrence D'Oliveiro wrote:
    On Thu, 29 May 2025 09:39:51 +0100, Richard Heathfield wrote:
    ...
    Is C90 perfect? No, of course not.

    Is there some value in that particular state of imperfection? Like the
    Amish, whose concept of the ideal level of technology is the one that was
    in effect at the time they were founded? And who have remained stuck at
    that point in time ever since?

    That's not actually the case. The Amish have slowly adopted more
    advanced levels of technology as the people around them have adopted
    farm more advanced ones. The important thing, from their point of view,
    it not a particular level of technology, but to maintain a clear
    distinction between them and the non-Amish.
    Which means that they are more adaptable than Richard is.

    They use a lot of C++, do they?

    --
    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 Lawrence D'Oliveiro on Thu May 29 15:06:40 2025
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    On Wed, 21 May 2025 19:23:45 +1000, Paul Edwards wrote:

    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message
    news:100j8t8$2g75r$5@dont-email.me...

    On Wed, 21 May 2025 07:41:12 +1000, Paul Edwards wrote:

    Basically the software industry is a joke. The advances have all been
    done by hardware engineers.

    Didn't they use software to manage that?

    Yes - as the guy (Jeff) said - software written by lunatics/artists.

    Was RCU invented by the hardware guys, or the software guys?

    It was invented by Sequent operating system engineers, who often
    have significant exposure and input in to the hardware design.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Richard Heathfield on Thu May 29 15:08:10 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 29/05/2025 11:11, James Kuyper wrote:
    On 5/29/25 05:37, Lawrence D'Oliveiro wrote:
    On Thu, 29 May 2025 09:39:51 +0100, Richard Heathfield wrote:
    ...
    Is C90 perfect? No, of course not.

    Is there some value in that particular state of imperfection? Like the
    Amish, whose concept of the ideal level of technology is the one that was >>> in effect at the time they were founded? And who have remained stuck at
    that point in time ever since?

    That's not actually the case. The Amish have slowly adopted more
    advanced levels of technology as the people around them have adopted
    farm more advanced ones. The important thing, from their point of view,
    it not a particular level of technology, but to maintain a clear
    distinction between them and the non-Amish.
    Which means that they are more adaptable than Richard is.

    They use a lot of C++, do they?

    They do love power tools.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Scott Lurndal on Thu May 29 17:36:21 2025
    On 29/05/2025 16:08, Scott Lurndal wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 29/05/2025 11:11, James Kuyper wrote:
    On 5/29/25 05:37, Lawrence D'Oliveiro wrote:
    On Thu, 29 May 2025 09:39:51 +0100, Richard Heathfield wrote:
    ...
    Is C90 perfect? No, of course not.

    Is there some value in that particular state of imperfection? Like the >>>> Amish, whose concept of the ideal level of technology is the one that was >>>> in effect at the time they were founded? And who have remained stuck at >>>> that point in time ever since?

    That's not actually the case. The Amish have slowly adopted more
    advanced levels of technology as the people around them have adopted
    farm more advanced ones. The important thing, from their point of view,
    it not a particular level of technology, but to maintain a clear
    distinction between them and the non-Amish.
    Which means that they are more adaptable than Richard is.

    They use a lot of C++, do they?

    They do love power tools.

    :-)

    If you want to take down a tree in a hurry, a chainsaw is just
    the job, but more delicate work requires more delicate tools.

    More to the point, if you have a million lines of legacy code all
    written in C90, it's a bloody good idea to keep a C90 compiler
    around because maintenance.

    --
    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 James Kuyper@21:1/5 to Richard Heathfield on Thu May 29 12:55:09 2025
    On 5/29/25 08:38, Richard Heathfield wrote:
    ...
    You can have new tools without breaking the old ones. We didn't
    have to change BCPL to get B, or B to get C, or C to get D or C++.

    This really is a very simple point, but perhaps a simple analogy
    will help to clarify it. You don't throw out your 3/4" just
    because you've bought a 19mm. There is room for both in the
    toolbox, and why write 3/4" on your new spanner? It /isn't/ a
    3/4" spanner even though it's very like it, so why pretend otherwise?

    That's why C99 is called C99, to distinguish it from C90 (and similarly
    for later versions). None of those revisions is large enough to justify
    giving the revised language an entirely new name.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Kaz Kylheku on Thu May 29 18:51:53 2025
    On 29/05/2025 18:18, Kaz Kylheku wrote:
    On 2025-05-29, Richard Heathfield <rjh@cpax.org.uk> wrote:
    If you want to take down a tree in a hurry, a chainsaw is just
    the job, but more delicate work requires more delicate tools.

    (I'm now searching YouTube for anyone in Asia who might be
    carving jade amulets with a chainsaw ...)


    Seek and you will find.

    I haven't found jade yet, but I think this is a step in your
    direction:

    <https://www.youtube.com/watch?v=9zo8KgEePB4>

    --
    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 Kaz Kylheku@21:1/5 to Richard Heathfield on Thu May 29 17:18:37 2025
    On 2025-05-29, Richard Heathfield <rjh@cpax.org.uk> wrote:
    If you want to take down a tree in a hurry, a chainsaw is just
    the job, but more delicate work requires more delicate tools.

    (I'm now searching YouTube for anyone in Asia who might be
    carving jade amulets with a chainsaw ...)

    --
    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 Richard Heathfield@21:1/5 to James Kuyper on Thu May 29 18:48:31 2025
    On 29/05/2025 17:55, James Kuyper wrote:
    On 5/29/25 08:38, Richard Heathfield wrote:
    ...
    You can have new tools without breaking the old ones. We didn't
    have to change BCPL to get B, or B to get C, or C to get D or C++.

    This really is a very simple point, but perhaps a simple analogy
    will help to clarify it. You don't throw out your 3/4" just
    because you've bought a 19mm. There is room for both in the
    toolbox, and why write 3/4" on your new spanner? It /isn't/ a
    3/4" spanner even though it's very like it, so why pretend otherwise?

    That's why C99 is called C99, to distinguish it from C90 (and similarly
    for later versions).

    Yes, I realise that.

    Obviously, we disagree about whether it's enough of a distinction
    to do the job.

    --
    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 David Brown@21:1/5 to Richard Heathfield on Thu May 29 21:24:57 2025
    On 29/05/2025 10:39, Richard Heathfield wrote:
    On 29/05/2025 08:27, Lawrence D'Oliveiro wrote:
    On Fri, 23 May 2025 23:13:20 +0100, Richard Heathfield wrote:

    And who cares about future instability if C90 remains just as stable as
    ever it was?

    Even with the problems with const?

         char *strstr(const char *haystack, const char *needle);

    Dennis Ritchie pointed out the trouble with that.

    Is C90 perfect? No, of course not. "C is quirky, flawed, and an enormous success."

    Is there value in having a powerful, widely-available language that,
    when you turn your back for a moment, stays *exactly* where you left it? Hell, yes.


    That's one of the reasons I like C99 and C11, and look forward to C23.
    Once implemented, they don't change either.

    I agree with all your are arguments on this, except for one - I can't understand why you think C90 is different from later C standards in this regard.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to David Brown on Thu May 29 21:27:41 2025
    On 29/05/2025 20:24, David Brown wrote:
    On 29/05/2025 10:39, Richard Heathfield wrote:
    On 29/05/2025 08:27, Lawrence D'Oliveiro wrote:
    On Fri, 23 May 2025 23:13:20 +0100, Richard Heathfield wrote:

    And who cares about future instability if C90 remains just as
    stable as
    ever it was?

    Even with the problems with const?

         char *strstr(const char *haystack, const char *needle);

    Dennis Ritchie pointed out the trouble with that.

    Is C90 perfect? No, of course not. "C is quirky, flawed, and an
    enormous success."

    Is there value in having a powerful, widely-available language
    that, when you turn your back for a moment, stays *exactly*
    where you left it? Hell, yes.


    That's one of the reasons I like C99 and C11, and look forward to
    C23. Once implemented, they don't change either.

    I agree with all your are arguments on this,

    So far so good. :-)

    except for one - I
    can't understand why you think C90 is different from later C
    standards in this regard.


    I realise that my reply is going to sound glib, but I can't help
    that.

    I *don't* think C90 is different. I think C90 is exactly the
    same. It's the later standards that are different. Different from
    C90.

    --
    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 Richard Heathfield@21:1/5 to Keith Thompson on Thu May 29 22:09:54 2025
    On 29/05/2025 21:45, Keith Thompson wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 29/05/2025 20:24, David Brown wrote:
    [...]
    That's one of the reasons I like C99 and C11, and look forward to
    C23. Once implemented, they don't change either.
    I agree with all your are arguments on this,

    So far so good. :-)

    except for one - I can't understand why you think C90 is different
    from later C standards in this regard.

    I realise that my reply is going to sound glib, but I can't help that.

    I *don't* think C90 is different. I think C90 is exactly the
    same. It's the later standards that are different. Different from C90.

    I'd like to understand the point you're trying to make.

    I'll do what I can to help out; I'm really not trying to be obscure.

    Being different is a transitive relationship. C90 is different
    "from later C standards". You say that C90 is "exactly the same"
    -- as what? As itself?

    Yes. And nothing else has that quality of being C90.

    C99 is also exactly the same as itself.

    Yes, but it's different from C99.

    If the difference is that you personally like C90 and dislike C99
    and later editions, that's fine. De gustibus non est disputandem
    (never argue with a guy named Gus).

    Look, Gus, if that's what you want to call yourself...well, okay,
    I can't in all honesty deny that de gustibus is part of it, but
    it's more to do with bit rot.

    Software houses need C90 for the same reason the government needs
    IBM 1311s (unless they've finished migrating off them now),
    cassette players, WW2 crypto keys, and the boot passwords for
    those early 1990s PCs lurking in the cellar.

    I shudder to think how much C90 code is out there, but it has to
    be /at least/ in the region of 10^9 LOC, much of it in the
    military arena, medical applications, and particularly the world
    of comms. Letting C90 compilers fall off the radar (e.g. by
    society forgetting how to program in it) really could be a
    stupendously bad idea, for all the reasons that people overlook
    when they shrug and say `I expect it'll all turn out fine'.

    --
    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 David Brown on Thu May 29 23:24:46 2025
    On Thu, 29 May 2025 21:24:57 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    On 29/05/2025 10:39, Richard Heathfield wrote:
    On 29/05/2025 08:27, Lawrence D'Oliveiro wrote:
    On Fri, 23 May 2025 23:13:20 +0100, Richard Heathfield wrote:

    And who cares about future instability if C90 remains just as
    stable as ever it was?

    Even with the problems with const?

    char *strstr(const char *haystack, const char *needle);

    Dennis Ritchie pointed out the trouble with that.

    Is C90 perfect? No, of course not. "C is quirky, flawed, and an
    enormous success."

    Is there value in having a powerful, widely-available language
    that, when you turn your back for a moment, stays *exactly* where
    you left it? Hell, yes.


    That's one of the reasons I like C99 and C11, and look forward to
    C23. Once implemented, they don't change either.

    I agree with all your are arguments on this, except for one - I can't understand why you think C90 is different from later C standards in
    this regard.


    The Great Slow Kings
    Roger Zelazny

    Drax and Dran sat in the great Throne Hall of Glan, discussing life. Monarchs by virtue of superior intellect and physique--and the fact
    that they were the last two survivors of the race of Glan--theirs was
    a divided rule over the planet and their one subject, Zindrome, the
    palace robot.

    Drax had been musing for the past four centuries (theirs was a sluggish
    sort) over the possibility of life on other planets in the galaxy.

    Accordingly, "Dran," said he, addressing the other (who was becoming
    mildly curious as to his thoughts), "Dran, I've been thinking. There
    may be life on other planets in the galaxy."

    Dran considered his response to this, as the world wheeled several
    times about its sun.

    "True," he finally agreed, "there may."

    After several months Drax shot back, "If there is, we ought to find
    out."

    "Why?" asked Dran with equal promptness, which caused the other to
    suspect that he, too, had been thinking along these lines.

    So he measured his next statement out cautiously, first testing each
    word within the plated retort of his reptilian skull.

    "Our kingdom is rather underpopulated at present," he observed. "It
    would be good to have many subjects once more."

    Dran regarded him askance, then slowly turned his head. He closed one
    eye and half-closed the other, taking full stock of his co-ruler, whose appearance, as he had suspected, was unchanged since the last time he
    had looked.

    "That, also, is true," he noted. "What do you suggest we do?"

    This time Drax turned, reappraising him, eye to eye.

    I think we ought to find out if there is life on other planets in the
    galaxy."

    "Hmm."

    Two quick rounds of the seasons went unnoticed, then, "Let me think
    about it," he said, and turned away.

    After what he deemed a polite period of time, Drax coughed.

    "Have you thought sufficiently?"

    "No."

    Drax struggled to focus his eyes on the near-subliminal streak of
    bluish light which traversed, re-traversed and re-re-traversed the Hall
    as he waited.

    "Zindrome!" he finally called out.

    The robot slowed his movements to a statue-like immobility to
    accommodate his master. A feather duster protruded from his right limb.

    "You called, great Lord of Glan?"

    "Yes, Zindrome, worthy subject. Those old spaceships which we
    constructed in happier days, and never got around to using. Are any of
    them still capable of operation?"

    "I'll check, great Lord."

    He seemed to change position slightly.

    "There are three hundred eighty-two," he announced, "of which four are
    in functioning condition, great Lord. I've checked all the operating
    circuits."

    "Drax," warned Dran, "you are arrogating unauthorized powers to
    yourself once more. You should have conferred with me before issuing
    that order."

    "I apologize," stated the other. "I simply wanted to expedite matters,
    should your decision be that we conduct a survey."

    "You have anticipated my decision correctly," nodded Dran, "but your
    eagerness seems to bespeak a hidden purpose."

    "No purpose but the good of the realm," smiled the other.

    "That may be, but the last time you spoke of 'the good of the realm'
    the civil strife which ensued cost us our other robot."

    "I have learned my lesson and profited thereby. I shall be more
    judicious in the future."

    "I hope so. Now, about this investigation--which part of the galaxy do
    you intend to investigate first?"

    A tension-filled pause ensued.

    "I had assumed," murmured Drax, "that you would conduct the expedition.
    Being the more mature monarch, yours should be a more adequate decision
    as to whether or not a particular species is worthy of our enlightened
    rule."

    "Yes, but your youth tends to make you more active than I. The journey
    should be more expeditiously conducted by you." He emphasized the word "expeditiously."

    "We could both go, in separate ships," offered Drax. "That would be
    truly expeditious--"

    Their heated debating was cut short by a metallic cough-equivalent.

    "Masters," suggested Zindrome, "the half-life of radioactive materials
    being as ephemeral as it is, I regret to report that only one spaceship
    is now in operational condition."

    "That settles it, Dran. _You_ go. It will require a steadier _rrand_ to
    manage an underpowered ship."

    "And leave you to foment civil strife and usurp unfranchised powers?
    No, you go!"

    "I suppose we could _both_ go," sighed Drax.

    "Fine! Leave the kingdom leaderless! _That_ is the kind of muddleheaded thinking which brought about our present political embarrassment."

    "Masters," said Zindrome, "if _someone_ doesn't go soon the ship will
    be useless."

    They both studied their servant, approving the rapid chain of logic
    forged by his simple statement.

    "Very well," they smiled in unison, "_you_ go."

    Zindrome bowed quite obsequiously and departed from the great Throne
    Hall of Glan.

    "Perhaps we should authorize Zindrome to construct facsimiles of
    himself," stated Dran, tentatively. "If we had more subjects we could accomplish more."

    "Are you forgetting our most recent agreement?" asked Drax. "A
    superfluity of robots tended to stimulate factionalism last time--and
    certain people grew ambitious..." He let his voice trail off over the
    years, for emphasis.

    "I am not certain as to whether your last allusion contains a hidden accusation," began the other carefully. "If so, permit me to caution
    you concerning rashness--and to remind you who it was who engineered
    the Mono-Robot Protection Pact."

    "Do you believe things will be different in the case of a multitude of
    organic subjects?" inquired the other.

    "Definitely," said Dran. "There is a certain irrational element in the rationale of the organic being, making it less amenable to direct
    orders than a machine would be. Our robots, at least, were faithful
    when we ordered them to destroy each other. Irresponsible organic
    subjects either do it without being told, which is boorish, or refuse
    to do it when you order them, which is insubordination."

    "True," smiled Drax, unearthing a gem he had preserved for millennia
    against this occasion. "Concerning organic life the only statement
    which can be made with certainty is that life is uncertain."

    "Hmm." Dran narrowed his eyes to slits. "Let me ponder that for a
    moment. Like much of your thinking it seems to smack of a concealed
    sophistry."

    "It contains none, I assure you. It is the fruit of much meditation."

    "Hmm."

    Dran's pondering was cut short, by the arrival of Zindrome who clutched
    two brownish blurs beneath his metal arms.

    "Back already, Zindrome? What have you there? Slow the down so we can
    see them."

    "They are under sedation at present, great Masters. It is the movements
    caused by their breathing which produce the unpleasant vibration
    pattern on your retinas. To subject them to more narcosis could prove deleterious."

    "Nevertheless," maintained Dran, "we must appraise our new subjects
    carefully, which requires that we see them. Slow them down some more."

    "You gave that order without-" began Drax, but was distracted by the
    sudden appearance of the two hairy bipeds.

    "Warm-blooded?" he asked.

    "Yes, Lord."

    "That bespeaks a very brief life-span."

    "True," offered Dran, "but that kind tends to reproduce quite rapidly."

    "That observation tends to be correct," nodded Drax. "Tell me,
    Zindrome, do they represent the sexes necessary for reproduction?"

    "Yes, Master. There are two sexes among these anthropoids, so I brought
    one of each."

    "That was very wise. Where did you find them?"

    "Several billion light years from here."

    "Turn those two loose outside and go fetch us some more."

    The creatures vanished. Zindrome appeared not to have moved.

    "Have you the fuel necessary for another such journey?"

    "Yes, my Lord. More of it has evolved recently."

    "Excellent."

    The robot departed.

    "What sort of governmental setup should be inaugurate this time?" asked
    Drax.

    "Set us review the arguments for the various types."

    "A good idea."

    In the midst of their discussion Zindrome returned and stood waiting to
    be recognized.

    "What is it, Zindrome? Did you forget something?"

    "No, great Lords. When I returned to the world from which I obtained
    the samples I discovered that the race had progressed to the point
    where it developed fission processes, engaged in an atomic war and
    annihilated itself."

    "That was extremely inconsiderate--typical, however, I should say, of warm-blooded instability."

    Zindrome continued to shift.

    "Have you something else to report?"

    "Yes, great Masters. The two specimens I released have multiplied and
    are now spread over the entire planet of Glan."

    "We should have been advised!"

    "Yes, great Lords, but I was absent and--"

    "They themselves should have reported this action!"

    "Masters, I am afraid they are unaware of your existence."

    "How could that have happened?" asked Dran.

    "We are presently buried beneath several thousand layers of alluvial
    rock. The geological shifts--"

    "You have your orders to maintain the place and clean the grounds,"
    glowered Dran. "Have you been frittering away your time again?"

    "No, great Lords! It all occurred during my absence. I shall attend to
    it immediately."

    "First," ordered Drax, "tell us what else our subjects have been up to,
    that they saw fit to conceal from us."

    "Recently," observed the robot, "they have discovered how to forge and
    temper metals. Upon landing, I observed that they had developed many
    ingenious instruments of a cutting variety. Unfortunately they were
    using them to cut one another."

    "Do you mean," roared Dran, "that there is strife in the kingdom?"

    "Uh, yes, my Lord."

    "I will not brook unauthorized violence among my subjects!"

    "_Our_ subjects," added Drax, with a meaningful glare.

    "_Our_ subjects," amended Dran. "We must take immediate action."

    "Agreed."

    "Agreed."

    "I shall issue orders forbidding their engagement in activities leading
    to bloodshed."

    "I presume that you mean a joint proclamation," stated Drax.

    "Of course. I was not slighting you, I was simply shaken by the civil emergency. We shall draft an official proclamation. Let Zindrome fetch
    us writing instruments."

    "Zindrome, fetch--"

    "I have them here, my Lords."

    "Now, let me see. How shall we phrase it...?"

    "Perhaps I should clean the palace while your Excellencies--"

    "No! Wait right here! This will be very brief and to the point."

    "Mm. 'We hereby proclaim...'"

    "Don't forget our titles."

    "True. 'We, the imperial monarchs of Glan, herebeneath undersigned, do hereby...'"

    A feeble pulse of gamma rays passed unnoticed by the two rulers. The
    faithful Zindrome diagnosed its nature, however, and tried
    unsuccessfully to obtain the monarchs' attention. Finally, he dismissed
    the project with a stoical gesture typical of his kind. He waited.


    There!" they agreed flourishing the document. "Now you can tell us what
    you have been trying to say, Zindrome. But make it brief, you just
    deliver this soon."

    "It is already too late, great Lords. This race, also, progressed into civilized states, developed nuclear energy and eradicated itself while
    you were writing."

    "Barbarous!"

    "Warm-blooded irresponsibility!"

    "May I go clean up now, great Masters?"

    "Soon, Zindrome, soon. First, though, I move that we file the
    proclamation in the Archives for future use, in the event of similar occurrences."

    Dran nodded.

    "I agree. _We_ so order."

    The robot accepted the crumbling proclamation and vanished from sight.

    "You know," Drax mused, "there must be lots of radioactive material
    lying about now..."

    "There probably is."

    "It could be used to fuel a ship for another expedition."

    "Perhaps."

    "This time we could instruct Zindrome to bring back something with a
    longer lifespan and more deliberate habits--somewhat nearer our own."

    "That would have its dangers. But perhaps we could junk the Mono-Robot Protection Pact and order Zindrome to manufacture extras of himself.
    Under strict supervision."

    "That would have its dangers too."

    "At any rate, I should have to ponder your suggestion carefully."

    "And I yours."

    "It's been a busy day," nodded Dran. "Let's sleep on it."

    "A good idea."

    Sounds of saurian snoring emerged from the great Throne Hall of Glan.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Richard Heathfield on Thu May 29 21:19:44 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 29/05/2025 21:45, Keith Thompson wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 29/05/2025 20:24, David Brown wrote:
    [...]
    That's one of the reasons I like C99 and C11, and look forward to
    C23. Once implemented, they don't change either.
    I agree with all your are arguments on this,

    So far so good. :-)

    except for one - I can't understand why you think C90 is different
    from later C standards in this regard.

    I realise that my reply is going to sound glib, but I can't help that.

    I *don't* think C90 is different. I think C90 is exactly the
    same. It's the later standards that are different. Different from C90.

    I'd like to understand the point you're trying to make.

    I'll do what I can to help out; I'm really not trying to be obscure.

    Being different is a transitive relationship. C90 is different
    "from later C standards". You say that C90 is "exactly the same"
    -- as what? As itself?

    Yes. And nothing else has that quality of being C90.

    C99 is also exactly the same as itself.

    Yes, but it's different from C99.

    If the difference is that you personally like C90 and dislike C99
    and later editions, that's fine. De gustibus non est disputandem
    (never argue with a guy named Gus).

    Look, Gus, if that's what you want to call yourself...well, okay,
    I can't in all honesty deny that de gustibus is part of it, but
    it's more to do with bit rot.

    Software houses need C90 for the same reason the government needs
    IBM 1311s (unless they've finished migrating off them now),
    cassette players, WW2 crypto keys, and the boot passwords for
    those early 1990s PCs lurking in the cellar.

    I shudder to think how much C90 code is out there, but it has to
    be /at least/ in the region of 10^9 LOC, much of it in the
    military arena, medical applications, and particularly the world
    of comms. Letting C90 compilers fall off the radar (e.g. by
    society forgetting how to program in it) really could be a
    stupendously bad idea, for all the reasons that people overlook
    when they shrug and say `I expect it'll all turn out fine'.

    And all the existing C compilers in the entire planet support
    the C90 dialect[*], if so instructed. Where is the problem?

    [*] Well, except perhap Bart's and various hobby compilers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Scott Lurndal on Thu May 29 22:40:09 2025
    On 29/05/2025 22:19, Scott Lurndal wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 29/05/2025 21:45, Keith Thompson wrote:

    <snip>

    C99 is also exactly the same as itself.

    Yes, but it's different from C99.

    No it isn't! It's different from C90. (Mea culpa; poor
    proofreading on my part.)

    <snip>

    I shudder to think how much C90 code is out there, but it has to
    be /at least/ in the region of 10^9 LOC, much of it in the
    military arena, medical applications, and particularly the world
    of comms. Letting C90 compilers fall off the radar (e.g. by
    society forgetting how to program in it) really could be a
    stupendously bad idea, for all the reasons that people overlook
    when they shrug and say `I expect it'll all turn out fine'.

    And all the existing C compilers in the entire planet support
    the C90 dialect[*], if so instructed.

    Indeed. It's hard to imagine a platform without a C90 compiler.
    That's an extraordinarily powerful quality that we would do well
    not to lose.

    Where is the problem?

    Where? I don't know. /When/ is the problem? When we forget that
    it matters.

    [*] Well, except perhap Bart's and various hobby compilers.

    Er, quite.

    --
    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 Richard Heathfield@21:1/5 to Keith Thompson on Fri May 30 00:05:22 2025
    On 29/05/2025 22:50, Keith Thompson wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 29/05/2025 21:45, Keith Thompson wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 29/05/2025 20:24, David Brown wrote:
    [...]
    That's one of the reasons I like C99 and C11, and look forward to
    C23. Once implemented, they don't change either.
    I agree with all your are arguments on this,

    So far so good. :-)

    except for one - I can't understand why you think C90 is different
    from later C standards in this regard.

    I realise that my reply is going to sound glib, but I can't help that. >>>>
    I *don't* think C90 is different. I think C90 is exactly the
    same. It's the later standards that are different. Different from C90.
    I'd like to understand the point you're trying to make.

    I'll do what I can to help out; I'm really not trying to be obscure.

    Being different is a transitive relationship. C90 is different
    "from later C standards". You say that C90 is "exactly the same"
    -- as what? As itself?

    Yes. And nothing else has that quality of being C90.

    C99 is also exactly the same as itself.

    Yes, but it's different from C99.

    I hope that was a typo. If you really meant that C99 is different from
    C99, I suggest that requires a bit more explanation.

    Typo, of course. (9 is next to 0.) Alas, my typo-free days are over.

    <snip>

    Obviously C90, C99, and C11 are all different from each other.
    You seem to be suggesting that C90 is special in some way that C99
    and C11 are not.

    Yes. Nothing magical, of course. But C90 was there first and is
    (fairly literally) universal as no other dialect is. It would be
    a mistake to lose that.


    If that's an accurate summary of your opinion,
    can you explain it?

    Not sure I can be any clearer than I already have been, which
    seems to have been about as clear as mud. Ah well.

    And if it isn't, just what are we talking about?

    Maybe I'm just being grumpy out loud instead of muttering dark
    imprecations into my coffee mug.

    --
    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 Lawrence D'Oliveiro@21:1/5 to Richard Heathfield on Fri May 30 03:10:04 2025
    On Thu, 29 May 2025 13:38:37 +0100, Richard Heathfield wrote:

    This really is a very simple point, but perhaps a simple analogy
    will help to clarify it. You don't throw out your 3/4" just
    because you've bought a 19mm. There is room for both in the
    toolbox, and why write 3/4" on your new spanner? It /isn't/ a
    3/4" spanner even though it's very like it, so why pretend otherwise?

    Let me clarify your analogy with another analogy: a language compiler is
    just like a spanner. Anything you can say about one, applies equally to another. The difference is, old language compilers can get worn, but
    spanners stay bright and new forever.

    Also, 19mm spanners are upward-compatible with ¾” ones, aren’t they? Any nuts you can handle with the old one, you can deal with using the new one, can’t you?

    Because argument by analogy works like that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Waldek Hebisch@21:1/5 to Richard Heathfield on Fri May 30 02:46:48 2025
    Richard Heathfield <rjh@cpax.org.uk> wrote:

    Software houses need C90 for the same reason the government needs
    IBM 1311s (unless they've finished migrating off them now),
    cassette players, WW2 crypto keys, and the boot passwords for
    those early 1990s PCs lurking in the cellar.

    I shudder to think how much C90 code is out there, but it has to
    be /at least/ in the region of 10^9 LOC, much of it in the
    military arena, medical applications, and particularly the world
    of comms. Letting C90 compilers fall off the radar (e.g. by
    society forgetting how to program in it) really could be a
    stupendously bad idea, for all the reasons that people overlook
    when they shrug and say `I expect it'll all turn out fine'.

    Clearly there is a lot of old code there. I am not sure why
    you think that C90 is very special here. I mean, goverment
    loves standards and for goverment project may mandate use
    of "standard" language, which could mean C90 in relevant
    period. However, business had tendency to use whatever their
    compilers supported, which frequently meant using vendor
    extentions. Due to extentions, I suspect that there is very
    little pure C90 code. Even if C90 was mandated it is not
    clear if C90 was really deliverd. More precisely, when you
    look at small snippets of C code there is good chance that
    they will be valid regardless of version of C that you use.
    However in large codebase one can expect some constructs that
    are not valid C90. Even for code born as pure C90, there is
    notrivial chance that maintanence introduced constructs
    from later C standards.

    AFAICS C99 and C11 did not introduced major incompatibilities
    with C90. OTOH some vendor extentions to C90 were
    standarized in C99 and C11. So, it is reasonable to suspect
    that amount of say C99 code is significantly larger
    than C90 code. Or may be better to say that deviation of
    C code from C99 is probably smaller than deviation from C90.

    Concerning new code it makes sense to avoid constructs that
    are made illegal in later standard, that is write to the
    latter of later standard even if you use only constructs
    available in C90. And concerning constructs not in C90,
    I find ability to mix declarations and statements important
    to readability. So any code that I write now is unlikely
    to be valid C90 for this (technically trivial) reason.
    For computational code multidimensional arrays are
    useful. In general purpose code sizes of arrays are
    typically only known at runtime, so it is natural to
    use variable modified types. Other people may find useful
    some other features of C99 or later standards, so there
    is incentive to go beyond C90.

    There is also historic aspect. C90 is part of history and
    I fully support preserving it (specification and actual
    programs) as historic artifacts. But I also think that
    C90 should be retired from practical use, that is code
    should be modernized to comply with later standards.
    If code needs to be very portable, than C90 compatibility
    makes sense, but for most code it it better to take
    advantage of newer features.

    BTW: In the past I used to point out to students that some
    features that they use in their programs are not C90 but
    say C99. But now I do not think that it is worth to
    bother students with information about C90.

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Waldek Hebisch on Fri May 30 03:42:44 2025
    On 2025-05-30, Waldek Hebisch <antispam@fricas.org> wrote:
    Concerning new code it makes sense to avoid constructs that
    are made illegal in later standard, that is write to the
    latter of later standard even if you use only constructs
    available in C90.

    Speaking of which, I like to avoid declarations mixed
    with statements. GCC supports that with a diagnostic: -Werror=declaration-after-statement.

    However, the wording of the diagnostic, when it goes off,
    is poor: it says something like "C90 doesn't allow
    mixed declarations and statements".

    Aaaargh! I said, error out for declarations after
    statements. I didn't say I'm writing in C90.
    Look, in the same function, I initialized an automatic
    aggregate with a non-constant, which is also not in C90!

    --
    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 Lawrence D'Oliveiro@21:1/5 to Richard Heathfield on Fri May 30 07:34:21 2025
    On Thu, 29 May 2025 22:09:54 +0100, Richard Heathfield wrote:

    I shudder to think how much C90 code is out there, but it has to be /at least/ in the region of 10^9 LOC, much of it in the military arena,
    medical applications, and particularly the world of comms.

    The military and aerospace were/are using Ada a lot. That’s why the 🇺🇸 DoD
    sponsored its creation, after all. And guess what: that is a language that
    is still alive and well and being maintained today. Because that is a
    language that was designed to be more robust against stupid errors than C
    could ever be.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Richard Heathfield on Fri May 30 11:20:44 2025
    On 29/05/2025 14:38, Richard Heathfield wrote:

    This really is a very simple point, but perhaps a simple analogy will
    help to clarify it. You don't throw out your 3/4" just because you've
    bought a 19mm. There is room for both in the toolbox, and why write 3/4"
    on your new spanner? It /isn't/ a 3/4" spanner even though it's very
    like it, so why pretend otherwise?


    Your analogy does not cover C99 vs C90.

    You have a good 3/4" spanner. You don't throw it out just because you
    also get an adjustable spanner - sometimes the 3/4" spanner is more
    practical, or perhaps a bit stronger. That's keeping C when you also
    have C++ available.

    You have a good 3/4" spanner. Now you get a new 3/4" spanner that is
    made of stronger steel, has a more comfortable grip, and has a box/ring
    at the other end which the old spanner did not. You probably won't
    throw out the old spanner, but most of the time you will now use the new spanner. That's C99 vs C90.

    Sometimes, of course, we have non-rational reasons for a preference.
    Maybe you just like using the old spanner because you've had it since
    you were a kid and there's an emotional attachment. Or maybe you don't
    like the shade of grey of the new spanner. That, of course, is fine -
    when something is good enough for the job, you don't need something
    better and can make the choice for any other personal reason. It is
    just very difficult for other people to understand such choices.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to David Brown on Fri May 30 11:54:32 2025
    On 30/05/2025 10:20, David Brown wrote:
    On 29/05/2025 14:38, Richard Heathfield wrote:

    This really is a very simple point, but perhaps a simple
    analogy will help to clarify it. You don't throw out your 3/4"
    just because you've bought a 19mm. There is room for both in
    the toolbox, and why write 3/4" on your new spanner? It /isn't/
    a 3/4" spanner even though it's very like it, so why pretend
    otherwise?


    Your analogy does not cover C99 vs C90.

    It does if we can construct a program that is legal C90 but not
    legal C99, which is easy enough, or (slightly harder but still
    not that hard) a program that is legal in both dialects but which
    gives different output under C99 than it does for C90.

    $ cat c9099.c;gcc -W -Wall -ansi -pedantic -o c90 c9099.c;gcc -o
    c99 c9099.c;./c90;./c99
    #include <stdio.h>

    int main(void)
    {
    int a = 42;

    int b = a //* comment */ 6;
    ;
    printf("Soln = %d\n", b);

    return 0;
    }
    Soln = 7
    Soln = 42

    Obviously it's a contrived example, but then examples pointing
    out the consequences of language differences invariably are.

    --
    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 David Brown@21:1/5 to Richard Heathfield on Fri May 30 16:02:18 2025
    On 30/05/2025 12:54, Richard Heathfield wrote:
    On 30/05/2025 10:20, David Brown wrote:
    On 29/05/2025 14:38, Richard Heathfield wrote:

    This really is a very simple point, but perhaps a simple analogy will
    help to clarify it. You don't throw out your 3/4" just because you've
    bought a 19mm. There is room for both in the toolbox, and why write
    3/4" on your new spanner? It /isn't/ a 3/4" spanner even though it's
    very like it, so why pretend otherwise?


    Your analogy does not cover C99 vs C90.

    It does if we can construct a program that is legal C90 but not legal
    C99, which is easy enough, or (slightly harder but still not that hard)
    a program that is legal in both dialects but which gives different
    output under C99 than it does for C90.

    $ cat c9099.c;gcc -W -Wall -ansi -pedantic -o c90 c9099.c;gcc -o c99 c9099.c;./c90;./c99
    #include <stdio.h>

    int main(void)
    {
      int a = 42;

      int b = a //* comment */ 6;
      ;
      printf("Soln = %d\n", b);

      return 0;
    }
    Soln = 7
    Soln = 42

    Obviously it's a contrived example, but then examples pointing out the consequences of language differences invariably are.


    The analogy there is like complaining you can't use the back end of your
    new spanner to hammer in nails, because it now has a box/ring at the end.


    About the only non-pathological circumstances where a C90 program could
    not be compiled as C99 and give the same result is if you happened to
    use the word "restrict" as an identifier.

    (And yes, I know there was a minor change in the types of certain
    integer constants, and that it is conceivable that a particularly
    unusual C90 compiler gave different unspecified rounding for negative
    division than on a C99 compiler.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to David Brown on Fri May 30 16:26:04 2025
    On 30/05/2025 15:02, David Brown wrote:
    On 30/05/2025 12:54, Richard Heathfield wrote:

    <snip>

    Obviously it's a contrived example, but then examples pointing
    out the consequences of language differences invariably are.


    The analogy there is like complaining you can't use the back end
    of your new spanner to hammer in nails, because it now has a
    box/ring at the end.

    Your argument now appears to be that people wouldn't need C90 if
    only they'd written their C90 in such a way that C99 would have
    met their needs.

    This is undoubtedly the case.

    --
    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 David Brown@21:1/5 to Richard Heathfield on Fri May 30 17:37:20 2025
    On 30/05/2025 01:05, Richard Heathfield wrote:
    On 29/05/2025 22:50, Keith Thompson wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 29/05/2025 21:45, Keith Thompson wrote:

    C99 is also exactly the same as itself.

    Yes, but it's different from C99.

    I hope that was a typo.  If you really meant that C99 is different from
    C99, I suggest that requires a bit more explanation.

    Typo, of course. (9 is next to 0.) Alas, my typo-free days are over.


    You are, I believe, older than me. At what age can I expect my
    typo-free days to start?

    :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Richard Heathfield on Fri May 30 17:42:32 2025
    On 30/05/2025 17:26, Richard Heathfield wrote:
    On 30/05/2025 15:02, David Brown wrote:
    On 30/05/2025 12:54, Richard Heathfield wrote:

    <snip>

    Obviously it's a contrived example, but then examples pointing out
    the consequences of language differences invariably are.


    The analogy there is like complaining you can't use the back end of
    your new spanner to hammer in nails, because it now has a box/ring at
    the end.

    Your argument now appears to be that people wouldn't need C90 if only
    they'd written their C90 in such a way that C99 would have met their needs.


    I can't see how you get that from what I wrote.

    However, it /is/ the case that most people write / wrote their C90 in
    such a way that C99 meets their needs. The good folks who gave us C99 specifically made backwards compatibility a priority (though not an
    absolute).

    I'm not sure we are getting anywhere with this thread...

    This is undoubtedly the case.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to David Brown on Fri May 30 17:32:39 2025
    On 30/05/2025 16:37, David Brown wrote:
    On 30/05/2025 01:05, Richard Heathfield wrote:
    On 29/05/2025 22:50, Keith Thompson wrote:
    Richard Heathfield <rjh@cpax.org.uk> writes:
    On 29/05/2025 21:45, Keith Thompson wrote:

    C99 is also exactly the same as itself.

    Yes, but it's different from C99.

    I hope that was a typo.  If you really meant that C99 is
    different from
    C99, I suggest that requires a bit more explanation.

    Typo, of course. (9 is next to 0.) Alas, my typo-free days are
    over.


    You are, I believe, older than me.  At what age can I expect my
    typo-free days to start?

    :-)

    I came up with a few answers to that, but you'll be glad to hear
    that I decided you didn't deserve any of them. ;-)

    --
    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 Richard Heathfield@21:1/5 to David Brown on Fri May 30 17:39:00 2025
    On 30/05/2025 16:42, David Brown wrote:
    <snip>
    I can't see how you get that from what I wrote.

    Perhaps I've been spending too long in comp.theory

    I'm not sure we are getting anywhere with this thread...

    Agreed. I can no longer remember how this sub-thread started, but
    I would guess that it was a wry aside that got bicycle-pumped out
    of proportion.

    void main(void)
    {
    char *s="Let's call the whole thing";
    printf("%s %s", s, gets(s));
    }

    --
    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 Richard Harnden@21:1/5 to David Brown on Fri May 30 17:25:12 2025
    On 30/05/2025 16:37, David Brown wrote:
    On 30/05/2025 01:05, Richard Heathfield wrote:

    Typo, of course. (9 is next to 0.) Alas, my typo-free days are over.


    You are, I believe, older than me.  At what age can I expect my typo-
    free days to start?

    Typo free days to /end/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Richard Harnden on Fri May 30 17:39:41 2025
    On 30/05/2025 17:25, Richard Harnden wrote:
    On 30/05/2025 16:37, David Brown wrote:
    On 30/05/2025 01:05, Richard Heathfield wrote:

    Typo, of course. (9 is next to 0.) Alas, my typo-free days are
    over.


    You are, I believe, older than me.  At what age can I expect my
    typo- free days to start?

    Typo free days to /end/

    No, I think he was right the first time.

    --
    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 Kaz Kylheku@21:1/5 to David Brown on Fri May 30 18:04:42 2025
    On 2025-05-30, David Brown <david.brown@hesbynett.no> wrote:
    On 29/05/2025 14:38, Richard Heathfield wrote:

    This really is a very simple point, but perhaps a simple analogy will
    help to clarify it. You don't throw out your 3/4" just because you've
    bought a 19mm. There is room for both in the toolbox, and why write 3/4"
    on your new spanner? It /isn't/ a 3/4" spanner even though it's very
    like it, so why pretend otherwise?


    Your analogy does not cover C99 vs C90.

    You have a good 3/4" spanner. You don't throw it out just because you
    also get an adjustable spanner - sometimes the 3/4" spanner is more practical, or perhaps a bit stronger. That's keeping C when you also
    have C++ available.

    You have a good 3/4" spanner. You also have an adjustable wrench.

    They are welded together and and the 3/4" spanner is written
    in the language of the adjustable one ...

    --
    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 Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Fri May 30 22:10:16 2025
    On Fri, 30 May 2025 18:18:43 +1000, Paul Edwards wrote:

    (The competition for first place being IBM's C compiler for z/OS)

    Come on, who writes C code for z/OS? Mainframes are supposed to be all
    about COBOL code, aren’t they? Or so we keep being told.

    And what might IBM’s COBOL compiler (and associated system utilities) be written in? Why, its long-time systems-programming language of choice,
    PL/I.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Bonita Montero on Sat May 31 21:42:05 2025
    On Sat, 31 May 2025 08:20:33 +0200, Bonita Montero wrote:

    Am 20.05.2025 um 09:27 schrieb Lawrence D'Oliveiro:

    On Tue, 20 May 2025 16:06:19 +1000, Paul Edwards wrote:

    And in essence, when you read from a directory, the only thing you get
    is the filename.

    You want at least the type of entry as well, surely.

    <https://manpages.debian.org/readdir(3)>

    Easier to handle: https://en.cppreference.com/w/cpp/filesystem/directory_iterator.html

    If you’re wanting language-specific facilities, then see if you can beat
    this <https://docs.python.org/3/library/os.html#os.walk>.

    For one thing, notice how it gives you the choice of whether to follow
    symlinks or not?

    Oh, and also notice os.fwalk(), which supports dirfds.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Bonita Montero on Sun Jun 1 07:43:19 2025
    On Sun, 1 Jun 2025 07:58:54 +0200, Bonita Montero wrote:

    Am 31.05.2025 um 23:42 schrieb Lawrence D'Oliveiro:

    On Sat, 31 May 2025 08:20:33 +0200, Bonita Montero wrote:

    Easier to handle:
    https://en.cppreference.com/w/cpp/filesystem/directory_iterator.html

    If you’re wanting language-specific facilities, then see if you can
    beat this <https://docs.python.org/3/library/os.html#os.walk>. For
    one thing, notice how it gives you the choice of whether to follow
    symlinks or not?

    Sth. like this:

    for( directory_entry const &de : recursive_directory_iterator( "\\", directory_options::follow_directory_symlink ) )
    cout << de.path() << endl;

    You need the dirfd functions to avoid certain potential security holes
    on operations with symlinks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Bonita Montero on Mon Jun 2 15:24:45 2025
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 01.06.2025 um 09:43 schrieb Lawrence D'Oliveiro:

    On Sun, 1 Jun 2025 07:58:54 +0200, Bonita Montero wrote:

    Sth. like this:

    for( directory_entry const &de : recursive_directory_iterator( "\\", >>> directory_options::follow_directory_symlink ) )
    cout << de.path() << endl;

    You need the dirfd functions to avoid certain potential security holes
    on operations with symlinks.

    Which security holes ?


    The fchownat() function shall be equivalent to the chown() and lchown()
    functions except in the case where path specifies a relative path. In
    this case the file to be changed is determined relative to the directory
    associated with the file descriptor fd instead of the current working
    directory. If the access mode of the open file description associated
    with the file descriptor is not O_SEARCH, the function shall check
    whether directory searches are permitted using the current permissions
    of the directory underlying the file descriptor. If the access mode is
    O_SEARCH, the function shall not perform the check.

    Similiter for fstatat, faccessat, fchownat, openat, readlinkat et alia.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Scott Lurndal on Mon Jun 2 19:14:08 2025
    On 6/2/25 11:24, Scott Lurndal wrote:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 01.06.2025 um 09:43 schrieb Lawrence D'Oliveiro:

    ...
    You need the dirfd functions to avoid certain potential security holes
    on operations with symlinks.

    Which security holes ?


    The fchownat() function shall be equivalent to the chown() and lchown() functions except in the case where path specifies a relative path. In
    this case the file to be changed is determined relative to the directory associated with the file descriptor fd instead of the current working directory. If the access mode of the open file description associated
    with the file descriptor is not O_SEARCH, the function shall check
    whether directory searches are permitted using the current permissions
    of the directory underlying the file descriptor. If the access mode is O_SEARCH, the function shall not perform the check.

    Similiter for fstatat, faccessat, fchownat, openat, readlinkat et alia.

    That describes what the functions do, it doesn't explain the potential
    security holes that they avoid. The hole might seem obvious to you, but
    it's certainly not obvious to me - probably because writing code to
    traverse directories is something I've almost never had to do.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to James Kuyper on Mon Jun 2 23:54:53 2025
    James Kuyper <jameskuyper@alumni.caltech.edu> writes:
    On 6/2/25 11:24, Scott Lurndal wrote:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 01.06.2025 um 09:43 schrieb Lawrence D'Oliveiro:

    ...
    You need the dirfd functions to avoid certain potential security holes >>>> on operations with symlinks.

    Which security holes ?


    The fchownat() function shall be equivalent to the chown() and lchown()
    functions except in the case where path specifies a relative path. In
    this case the file to be changed is determined relative to the directory
    associated with the file descriptor fd instead of the current working
    directory. If the access mode of the open file description associated
    with the file descriptor is not O_SEARCH, the function shall check
    whether directory searches are permitted using the current permissions
    of the directory underlying the file descriptor. If the access mode is
    O_SEARCH, the function shall not perform the check.

    Similiter for fstatat, faccessat, fchownat, openat, readlinkat et alia.

    That describes what the functions do, it doesn't explain the potential >security holes that they avoid. The hole might seem obvious to you, but
    it's certainly not obvious to me - probably because writing code to
    traverse directories is something I've almost never had to do.



    From the posix standard:

    "The purpose of the fstatat() function is to obtain the status
    of files in directories other than the current working directory
    without exposure to race conditions. Any part of the path of a
    file could be changed in parallel to a call to stat(), resulting
    in unspecified behavior. By opening a file descriptor for the target
    directory and using the fstatat() function it can be guaranteed that
    the file for which status is returned is located relative to the desired directory."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Bonita Montero on Tue Jun 3 00:37:39 2025
    On Mon, 2 Jun 2025 09:35:24 +0200, Bonita Montero wrote:

    Am 01.06.2025 um 09:43 schrieb Lawrence D'Oliveiro:

    On Sun, 1 Jun 2025 07:58:54 +0200, Bonita Montero wrote:

    Sth. like this:

    for( directory_entry const &de : recursive_directory_iterator( "\\", >>> directory_options::follow_directory_symlink ) )
    cout << de.path() << endl;

    You need the dirfd functions to avoid certain potential security
    holes on operations with symlinks.

    Which security holes ?

    TOCTOU.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Scott Lurndal on Tue Jun 3 01:02:54 2025
    On 2025-06-02, Scott Lurndal <scott@slp53.sl.home> wrote:
    From the posix standard:

    "The purpose of the fstatat() function is to obtain the status
    of files in directories other than the current working directory
    without exposure to race conditions. Any part of the path of a
    file could be changed in parallel to a call to stat(), resulting
    in unspecified behavior. By opening a file descriptor for the target
    directory and using the fstatat() function it can be guaranteed that
    the file for which status is returned is located relative to the desired directory."

    The security guarantee you want is that when you follow some path
    /a/b/c/d/.., that none of the path components "a", "b", "c", "d", ...
    are under the control of an adversary. Adversary means any other user
    who is not you or root. (If you are root, any other user, therefore).

    If, say "c" is under the control of an adversary, then the adversary can
    make it a symlink, so that "d" is then anything whatsoever in any
    location whatsoever.

    I've developed an experimental security library called safepath
    which tries to validate a path for this kind of safety.

    https://www.kylheku.com/cgit/safepath/about/

    Caveat: note the lack of a test suite in this project!

    It doesn't rely on these functions because, it's not necesary.
    If you know that /a/b/c is safe, then by induction you can proceed
    to /a/b/c/d. For instance if you are root, and non-root is not able
    to tamper with /a/b/c, then, generally speaking, there is no race
    condition to worry about in making two accesses to c: one to check its permissions and ownership, and another to traverse it.

    --
    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 Scott Lurndal@21:1/5 to Bonita Montero on Tue Jun 3 18:25:17 2025
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 02.06.2025 um 17:24 schrieb Scott Lurndal:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 01.06.2025 um 09:43 schrieb Lawrence D'Oliveiro:

    On Sun, 1 Jun 2025 07:58:54 +0200, Bonita Montero wrote:

    Sth. like this:

    for( directory_entry const &de : recursive_directory_iterator( "\\", >>>>> directory_options::follow_directory_symlink ) )
    cout << de.path() << endl;

    You need the dirfd functions to avoid certain potential security holes >>>> on operations with symlinks.

    Which security holes ?


    The fchownat() function shall be equivalent to the chown() and lchown() >> functions except in the case where path specifies a relative path. In
    this case the file to be changed is determined relative to the directory >> associated with the file descriptor fd instead of the current working
    directory. If the access mode of the open file description associated
    with the file descriptor is not O_SEARCH, the function shall check
    whether directory searches are permitted using the current permissions >> of the directory underlying the file descriptor. If the access mode is >> O_SEARCH, the function shall not perform the check.

    And why is this relevant for directory_iterator or >recursive_directory_iterator ?

    Why are you asking this question on comp.lang.c?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Paul Edwards on Wed Jun 4 13:05:14 2025
    "Paul Edwards" <mutazilah@gmail.com> writes:
    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message

    And I know what you're thinking - all the data is in EBCDIC.
    There are no other EBCDIC systems I could possibly jump to.

    Except for various Unisys systems, which are still being sold.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Paul Edwards on Wed Jun 4 17:30:30 2025
    On 04/06/2025 11:23, Paul Edwards wrote:

    And I know what you're thinking - all the data is in EBCDIC.
    There are no other EBCDIC systems I could possibly jump to.
    We would need an 80386 EBCDIC version of Win32 in order
    for this to be remotely possible - which doesn't exist, and likely
    never will exist.

    For it to exist it would need some sort of pseudo-bios concept
    that allowed charset conversion. And no such thing exists as far
    as I am aware!


    You don't need an EBCDIC operating system, or "pseudo-bios" (whatever
    /that/ might be) to use data using EBCDIC character encoding. It is no different from working with any other character encoding - ASCII, UTF-8, different 8-bit code pages, or whatever. If the data is just passing
    through your code, read it in and pass it out without a care. If you
    need to convert it or mix it with some other encoding, work with a
    common encoding - UTF-8 is normally the right choice.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Josef_M=C3=B6llers?=@21:1/5 to David Brown on Wed Jun 4 20:48:45 2025
    On 04.06.25 17:30, David Brown wrote:
    On 04/06/2025 11:23, Paul Edwards wrote:

    And I know what you're thinking - all the data is in EBCDIC.
    There are no other EBCDIC systems I could possibly jump to.
    We would need an 80386 EBCDIC version of Win32 in order
    for this to be remotely possible - which doesn't exist, and likely
    never will exist.

    For it to exist it would need some sort of pseudo-bios concept
    that allowed charset conversion. And no such thing exists as far
    as I am aware!


    You don't need an EBCDIC operating system, or "pseudo-bios" (whatever
    /that/ might be) to use data using EBCDIC character encoding.  It is no different from working with any other character encoding - ASCII, UTF-8, different 8-bit code pages, or whatever.  If the data is just passing through your code, read it in and pass it out without a care.  If you
    need to convert it or mix it with some other encoding, work with a
    common encoding - UTF-8 is normally the right choice.

    This might be true if there were no special characters, but eg the slash
    is 2FH in ASCII but 61H in EBCDIC, so Linux may have a problem there.
    The backslash is 0E0H in EBCDIC (at least in Australia, Brasil, Canada,
    and various other countries), 0ECH in Germany and Austria while it is
    5CH in ASCII. So DOS and Windows have a problem here.

    So, YES, the operating system has to be aware of the code set used.

    Josef

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Paul Edwards on Wed Jun 4 19:19:45 2025
    On 2025-06-04, Paul Edwards <mutazilah@gmail.com> wrote:
    If I have existing C code that does:

    fopen("test1.dat", "rb");
    fread into buf
    if (memcmp(buf + 5, "XYZ", 3) == 0)

    and test1.dat is in EBCDIC, the above program on the 80386
    has been compiled with EBCDIC strings, so it works, and then
    now you do:

    printf("It matches!\n");

    where do you expect those characters in the printf string - all
    currently EBCDIC - to be translated to ASCII on a modern
    Windows 10/11 system?

    I think that in this case you would ideally want the EBCDIC-enabled
    compiler to have extensions for working with both character sets.

    For isntance E"foo" would specify a string object that is
    encoded in EBCDIC in the execution environment, whereas
    "foo" is ASCII.

    You could develop a textual preprocesor which implements
    this transformation: tokenizes the C well enough to recognize
    string literals preceded by E, and translates them to
    string literals without E, whose content is EBCDIC bytes.

    It wouldn't have to be absoultely perfect; only to work
    correctly on your small amount of private code.

    --
    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 Scott Lurndal@21:1/5 to josef@invalid.invalid on Wed Jun 4 21:09:13 2025
    =?UTF-8?Q?Josef_M=C3=B6llers?= <josef@invalid.invalid> writes:
    On 04.06.25 17:30, David Brown wrote:
    On 04/06/2025 11:23, Paul Edwards wrote:

    And I know what you're thinking - all the data is in EBCDIC.
    There are no other EBCDIC systems I could possibly jump to.
    We would need an 80386 EBCDIC version of Win32 in order
    for this to be remotely possible - which doesn't exist, and likely
    never will exist.

    For it to exist it would need some sort of pseudo-bios concept
    that allowed charset conversion. And no such thing exists as far
    as I am aware!


    You don't need an EBCDIC operating system, or "pseudo-bios" (whatever
    /that/ might be) to use data using EBCDIC character encoding.  It is no
    different from working with any other character encoding - ASCII, UTF-8,
    different 8-bit code pages, or whatever.  If the data is just passing
    through your code, read it in and pass it out without a care.  If you
    need to convert it or mix it with some other encoding, work with a
    common encoding - UTF-8 is normally the right choice.

    This might be true if there were no special characters, but eg the slash
    is 2FH in ASCII but 61H in EBCDIC, so Linux may have a problem there.
    The backslash is 0E0H in EBCDIC (at least in Australia, Brasil, Canada,
    and various other countries), 0ECH in Germany and Austria while it is
    5CH in ASCII. So DOS and Windows have a problem here.

    There's more than one EBCDIC encoding, the Burroughs encoding differs
    from the IBM encoding in several areas; '[' and ']' in particular.


    So, YES, the operating system has to be aware of the code set used.

    David was referring to the application, not the OS. As he said,
    the application writer can do whatever is necessary to support EBCDIC, including translating it to ASCII when communicating with code that
    doesn't support EBCDIC.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Paul Edwards on Wed Jun 4 21:30:38 2025
    On 2025-06-04, Paul Edwards <mutazilah@gmail.com> wrote:
    "Kaz Kylheku" <643-408-1753@kylheku.com> wrote in message news:20250604121550.286@kylheku.com...
    On 2025-06-04, Paul Edwards <mutazilah@gmail.com> wrote:
    If I have existing C code that does:

    fopen("test1.dat", "rb");
    fread into buf
    if (memcmp(buf + 5, "XYZ", 3) == 0)

    and test1.dat is in EBCDIC, the above program on the 80386
    has been compiled with EBCDIC strings, so it works, and then
    now you do:

    printf("It matches!\n");

    where do you expect those characters in the printf string - all
    currently EBCDIC - to be translated to ASCII on a modern
    Windows 10/11 system?

    I think that in this case you would ideally want the EBCDIC-enabled
    compiler to have extensions for working with both character sets.

    For isntance E"foo" would specify a string object that is
    encoded in EBCDIC in the execution environment, whereas
    "foo" is ASCII.

    You could develop a textual preprocesor which implements
    this transformation: tokenizes the C well enough to recognize
    string literals preceded by E, and translates them to
    string literals without E, whose content is EBCDIC bytes.

    It wouldn't have to be absoultely perfect; only to work
    correctly on your small amount of private code.

    Even assuming the above was technically possible - what's
    wrong with just having a pseudo-bios and OS so that
    everything is totally clean?

    Nothing; it's just that the OS doesn't match the requirement given in
    some above quoted text I was responding to that this is on "modern
    Windows 10/11 system" which requires the program output to be
    "translated to ASCII".

    (There are obvious advantages to working with a widely used,
    contemporary system; I don't see it necessary to go into those.)

    A C program built on and running on an ASCII system, handling EBCDIC
    data, could benefit from having an E"..." string literal feature, as
    well as a E' ' character constant feature, either as a compiler
    extension or a preprocessing tool, so that in places where EBCDIC text
    is being handled, literals in that encoding could be conveniently
    specified.

    --
    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 Scott Lurndal@21:1/5 to Kaz Kylheku on Wed Jun 4 22:38:29 2025
    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    On 2025-06-04, Paul Edwards <mutazilah@gmail.com> wrote:
    "Kaz Kylheku" <643-408-1753@kylheku.com> wrote in message
    news:20250604121550.286@kylheku.com...
    On 2025-06-04, Paul Edwards <mutazilah@gmail.com> wrote:
    If I have existing C code that does:

    fopen("test1.dat", "rb");
    fread into buf
    if (memcmp(buf + 5, "XYZ", 3) == 0)

    and test1.dat is in EBCDIC, the above program on the 80386
    has been compiled with EBCDIC strings, so it works, and then
    now you do:

    printf("It matches!\n");

    where do you expect those characters in the printf string - all
    currently EBCDIC - to be translated to ASCII on a modern
    Windows 10/11 system?

    I think that in this case you would ideally want the EBCDIC-enabled
    compiler to have extensions for working with both character sets.

    For isntance E"foo" would specify a string object that is
    encoded in EBCDIC in the execution environment, whereas
    "foo" is ASCII.

    You could develop a textual preprocesor which implements
    this transformation: tokenizes the C well enough to recognize
    string literals preceded by E, and translates them to
    string literals without E, whose content is EBCDIC bytes.

    It wouldn't have to be absoultely perfect; only to work
    correctly on your small amount of private code.

    Even assuming the above was technically possible - what's
    wrong with just having a pseudo-bios and OS so that
    everything is totally clean?

    Nothing; it's just that the OS doesn't match the requirement given in
    some above quoted text I was responding to that this is on "modern
    Windows 10/11 system" which requires the program output to be
    "translated to ASCII".

    (There are obvious advantages to working with a widely used,
    contemporary system; I don't see it necessary to go into those.)

    A C program built on and running on an ASCII system, handling EBCDIC
    data, could benefit from having an E"..." string literal feature, as
    well as a E' ' character constant feature, either as a compiler
    extension or a preprocessing tool, so that in places where EBCDIC text
    is being handled, literals in that encoding could be conveniently
    specified.

    Or just use https://en.wikipedia.org/wiki/UTF-EBCDIC

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Lawrence D'Oliveiro on Wed Jun 4 23:48:20 2025
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    On Wed, 4 Jun 2025 19:23:42 +1000, Paul Edwards wrote:


    Most of the remaining COBOL code nowadays is compiled with ... wait for
    it ... GNU COBOL. And the GNU compiler suite is, I believe, written in C++
    at its core these days (used to be C).

    I suspect your rather baseless assertion would be a surprise to Micro Focus.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Paul Edwards on Wed Jun 4 23:22:00 2025
    On Wed, 4 Jun 2025 19:23:42 +1000, Paul Edwards wrote:

    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:101dac8$mkpm$3@dont-email.me...

    Mainframes are supposed to be all about COBOL code, aren't they? Or so
    we keep being told.

    That would make the IBM COBOL compiler the most important compiler in
    the world, not the most important C compiler in the world.

    We heard that 20-30 years ago. IBM’s declining fortunes over all that time clearly indicate otherwise: batch-oriented mainframes are simply not a
    growth market. All that COBOL code is going out of use, one way or
    another: if the companies reliant on it don’t retire it, they are more
    likely to go out of business anyway. It’s just free-market competition in action.

    Most of the remaining COBOL code nowadays is compiled with ... wait for
    it ... GNU COBOL. And the GNU compiler suite is, I believe, written in C++
    at its core these days (used to be C).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Paul Edwards on Thu Jun 5 08:32:18 2025
    On 04/06/2025 20:58, Paul Edwards wrote:
    "David Brown" <david.brown@hesbynett.no> wrote in message news:101poqm$t350$1@dont-email.me...
    On 04/06/2025 11:23, Paul Edwards wrote:

    And I know what you're thinking - all the data is in EBCDIC.
    There are no other EBCDIC systems I could possibly jump to.
    We would need an 80386 EBCDIC version of Win32 in order
    for this to be remotely possible - which doesn't exist, and likely
    never will exist.

    For it to exist it would need some sort of pseudo-bios concept
    that allowed charset conversion. And no such thing exists as far
    as I am aware!

    You don't need an EBCDIC operating system, or "pseudo-bios" (whatever
    /that/ might be) to use data using EBCDIC character encoding. It is no
    different from working with any other character encoding - ASCII, UTF-8,
    different 8-bit code pages, or whatever. If the data is just passing
    through your code, read it in and pass it out without a care. If you
    need to convert it or mix it with some other encoding, work with a
    common encoding - UTF-8 is normally the right choice.

    If I have existing C code that does:

    fopen("test1.dat", "rb");
    fread into buf
    if (memcmp(buf + 5, "XYZ", 3) == 0)

    and test1.dat is in EBCDIC, the above program on the 80386
    has been compiled with EBCDIC strings, so it works, and then
    now you do:

    printf("It matches!\n");

    where do you expect those characters in the printf string - all
    currently EBCDIC - to be translated to ASCII on a modern
    Windows 10/11 system?


    In /your/ code!

    /You/ are responsible for writing the code that handles the data, and
    which gets the encoding right. If you want to handle data in an odd
    encoding, write code to handle it. That's what everyone else does when
    dealing with data in different encodings.


    And how do you expect Windows 10/11 to find "test1.dat" -
    all EBCDIC on its current ASCII filesystem?

    Convert the character encoding for the string.

    People do this all the time. They write code that uses UTF-8, and have
    to deal with Windows crappy UCS2 / partial UTF-16 / wchar_t mess. Or
    they have code that supports different code pages because they started
    it in the pre-Unicode days and don't live in a little American-only
    ASCII bubble.

    C does not make this stuff particularly convenient, though it has
    improved a little since C90 - other languages have vastly superior
    string and encoding handling. But that does not mean you can't do it,
    or should not do it.

    Maybe if you actually wanted to contribute something useful to the C
    world - something that other people might find useful - you could put
    your efforts into writing a library that has functions for converting
    encodings back and forth with UTF-8 as the base. Include support for
    the dozen different EDBDIC versions.

    Or do you really think that if someone sent me a file to read that was
    in EDBDIC encoding, I'd be happy to install an EDBDIC "pseudo-bios" and
    EDBDIC version of Windows so that I could read it?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to All on Thu Jun 5 08:18:27 2025
    On 04/06/2025 20:48, Josef Möllers wrote:
    On 04.06.25 17:30, David Brown wrote:
    On 04/06/2025 11:23, Paul Edwards wrote:

    And I know what you're thinking - all the data is in EBCDIC.
    There are no other EBCDIC systems I could possibly jump to.
    We would need an 80386 EBCDIC version of Win32 in order
    for this to be remotely possible - which doesn't exist, and likely
    never will exist.

    For it to exist it would need some sort of pseudo-bios concept
    that allowed charset conversion. And no such thing exists as far
    as I am aware!


    You don't need an EBCDIC operating system, or "pseudo-bios" (whatever
    /that/ might be) to use data using EBCDIC character encoding.  It is
    no different from working with any other character encoding - ASCII,
    UTF-8, different 8-bit code pages, or whatever.  If the data is just
    passing through your code, read it in and pass it out without a care.
    If you need to convert it or mix it with some other encoding, work
    with a common encoding - UTF-8 is normally the right choice.

    This might be true if there were no special characters, but eg the slash
    is 2FH in ASCII but 61H in EBCDIC, so Linux may have a problem there.
    The backslash is 0E0H in EBCDIC (at least in Australia, Brasil, Canada,
    and various other countries), 0ECH in Germany and Austria while it is
    5CH in ASCII. So DOS and Windows have a problem here.

    So, YES, the operating system has to be aware of the code set used.


    No, it does not.

    Data is not handled by an OS, data is handled by an application. When
    an OS reads or writes a file, it doesn't care if it is in ASCII,
    UTF-EBCDIC, a jpeg file, or anything else. That is up to the
    application code.

    When the application is interacting with the OS in a way that uses
    text-based parameters - such as for opening files, creating directories
    and the like - then the application needs to make sure the parameters it
    sends are in the appropriate format. If the OS call expects ASCII, the application must ensure it is ASCII - not UTF-8 or anything else. If
    the application has a filename in UTF-8 or EBCDIC and the OS expects
    UCS2, then the application has to convert the encoding first. If the OS
    treats certain characters in a special way, then the application needs
    to ensure it uses those characters appropriately. The same applies with interaction with any other library or code, not just OS calls.

    This is all exactly the same for any character encoding. There is
    nothing remotely special about EBCDIC other than it's horrible design
    and dozen different incompatible encodings.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Waldek Hebisch@21:1/5 to David Brown on Fri Jun 6 03:26:40 2025
    David Brown <david.brown@hesbynett.no> wrote:

    Maybe if you actually wanted to contribute something useful to the C
    world - something that other people might find useful - you could put
    your efforts into writing a library that has functions for converting encodings back and forth with UTF-8 as the base. Include support for
    the dozen different EDBDIC versions.

    AFAICS librecode already exists and can do this.

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Bonita Montero on Fri Jun 6 14:10:07 2025
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 03.06.2025 um 20:25 schrieb Scott Lurndal:

    The fchownat() function shall be equivalent to the chown() and lchown()
    functions except in the case where path specifies a relative path. In >>>> this case the file to be changed is determined relative to the directory
    associated with the file descriptor fd instead of the current working >>>> directory. If the access mode of the open file description associated >>>> with the file descriptor is not O_SEARCH, the function shall check >>>> whether directory searches are permitted using the current permissions
    of the directory underlying the file descriptor. If the access mode is
    O_SEARCH, the function shall not perform the check.

    And why is this relevant for directory_iterator or
    recursive_directory_iterator ?

    Why are you asking this question on comp.lang.c?

    Because you can have it easier than with opendir() / readdir().

    Personally, I'd use nftw to iterate over a path.

    https://pubs.opengroup.org/onlinepubs/9799919799/functions/nftw.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Bonita Montero on Fri Jun 6 17:24:50 2025
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 06.06.2025 um 16:10 schrieb Scott Lurndal:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 03.06.2025 um 20:25 schrieb Scott Lurndal:

    The fchownat() function shall be equivalent to the chown() and lchown()
    functions except in the case where path specifies a relative path. In
    this case the file to be changed is determined relative to the directory
    associated with the file descriptor fd instead of the current working
    directory. If the access mode of the open file description associated
    with the file descriptor is not O_SEARCH, the function shall check >>>>>> whether directory searches are permitted using the current permissions
    of the directory underlying the file descriptor. If the access mode is
    O_SEARCH, the function shall not perform the check.

    And why is this relevant for directory_iterator or
    recursive_directory_iterator ?

    Why are you asking this question on comp.lang.c?

    Because you can have it easier than with opendir() / readdir().

    Personally, I'd use nftw to iterate over a path.

    https://pubs.opengroup.org/onlinepubs/9799919799/functions/nftw.html

    That would be much nicer with a lambda which can take the context
    of the calling function.


    That's a matter of opinion. In any case, nftw is a C function
    and C doesn't support lamda functions. nftw can be used
    in any C++ code, it is not restricted to C++17 or higher,
    which makes it far more portable than std::filesystem::directory_iterator
    (not to mention much easier to type :-).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Michael S on Fri Jun 6 17:26:21 2025
    Michael S <already5chosen@yahoo.com> writes:

    On Tue, 27 May 2025 16:16:50 -0700
    Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

    Michael S <already5chosen@yahoo.com> writes:

    On Tue, 27 May 2025 16:23:22 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    On 26/05/2025 07:19, Peter 'Shaggy' Haywood wrote:

    Groovy hepcat Tim Rentsch was jivin' in comp.lang.c on Fri, 23 May
    2025 10:43 pm. It's a cool scene! Dig it.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Methinks Tim is having trouble with his arithmetic. Either
    that or he doesn't know what year it is now. :)
    C99 was ratified in 1999, over two and a half decades ago.

    C11 is just as stable as C90, and has been for just slightly
    less than a decade.

    And C11 was ratified in 2011, no? That was almost a decade
    and a half ago.

    Tim was, I believe, taking into account the time it took for common
    implementations of C compilers and libraries to have complete and
    generally bug-free support for the standards, and for these
    implementations to become common. C99 was published in 1999, but
    it took quite a while before most people programming in C could
    happily use C99 without worrying about the tool support being
    "experimental" or not as mature as C90 support.

    I believe that your belief is wrong.
    It is much more likely that Tim took into account defect reports.
    Here is the list of C11 defect reports with the last dated 2016:
    https://open-std.org/jtc1/sc22/wg14/www/docs/summary.htm

    I did not find similar list for C99. However believing Tim I would
    guess that the last change in C99 document was made ~15 years ago.

    You are partly right. Besides defect reports, there are TCs. And
    there is always the possibility of future TCs, future defect
    reports, or future changes for any ISO C standard while it is
    still current.

    To be as stable as C90, a C standard would need to be immune to
    the possibility of such future changes.

    I take C99 to have reached this level of stability in 2011, when
    it was superseded by C11. I take C11 to have reached this level
    of stability in 2017, when it was superseded by C17.

    Got it. Stability occurs when the standards is fenced from
    changes by presence of the next edition.
    Stability by obsolescence.

    Right except the word obsolescence is not appropriate. The release
    of C99 doesn't make C90 either obsolete or obsolescent. It is
    possible that a given earlier edition of C will become either
    obsolete or obsolescent, but it isn't the release of a subsequent
    edition that does that. Stability happens when a subsequent edition
    is ratified, regardless of when or whether an earlier edition ever
    becomes either obsolete or obsolescent. No edition of C is now
    obsolete, nor do I expect any of them will be during our lifetimes.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Kaz Kylheku on Fri Jun 6 17:16:09 2025
    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    On 2025-05-28, Michael S <already5chosen@yahoo.com> wrote:

    Got it. Stability occurs when the standards is fenced from
    changes by presence of the next edition.

    Each technical corrigendum effectively yields a new edition.

    The previous standard without that corrigendum is forever stable,
    as any immutable object.

    There are two reasons why these comments are off base.

    The first is the word "edition" is wrong. All of the ISO documents
    related to C99, whether the original one or a later one associated
    with a TC, all say "this second edition...". And similarly for
    other versions of the language.

    The second is that the discussion is not about what is covered by
    ISO labels but about C90, C99, C11, etc. Each of these names is
    about one edition of the language, no matter how many separate ISO
    documents are involved, and that's what the conversation is
    concerned with. The documents might be immutable, but the documents
    are not what is under discussion, which is different versions (in
    other words editions, in the official terminology of the ISO C
    standards) of the C language.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Bonita Montero on Sat Jun 7 23:12:23 2025
    On 07.06.2025 21:22, Bonita Montero wrote:
    Am 07.06.2025 um 20:43 schrieb wij:

    The basic problem of throwing error is losing error context, [...]

    Nonsense.

    The context doesn't matter. A bad_alloc doesn't need context, a
    system_error also not. And that's most of the exceptions the C++
    runtime throws (some are derived from system_error).

    Context, in the general case, matters. It's been decades that I
    used C++, but back then in the 1990's we did pass error context
    with the thrown error object. That's an inherent part of C++'s
    exception handling. If you use standard error classes without
    context that's of course possible, but nothing prevents you to
    define yet another error class derived from some existing error
    class with additional information. You are actually free to do
    what suits you and your projects best; use rudimentary handling,
    or have a sophisticated error framework, or anything in between.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@DastardlyHQ.org@21:1/5 to All on Sun Jun 8 08:55:52 2025
    On Sun, 8 Jun 2025 10:06:58 +0200
    Bonita Montero <Bonita.Montero@gmail.com> wibbled:
    Am 07.06.2025 um 21:56 schrieb wij:

    I see std::filesystem as evidence that C++ finally admits the deficiency of >> its advance error handling system (std::exception). But the result is worse
    than C.

    That's just a mere assertion without any facts. In fact, exception
    handling makes error handling possible with a fraction of the code
    length, because most parts of the code don't need to handle errors,
    whereas in C they do. In C every call level has to deal with erorrs,
    whereas in C++ only one level at the upper edge has to catch the
    errors.

    You can of course use setjmp & longjmp in C but depending on how many levels
    up you jump they could be more trouble than they're worth. I think I've only ever used them once.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@DastardlyHQ.org@21:1/5 to All on Sun Jun 8 15:08:16 2025
    On Sun, 8 Jun 2025 17:02:08 +0200
    Bonita Montero <Bonita.Montero@gmail.com> wibbled:
    Am 08.06.2025 um 10:55 schrieb Muttley@DastardlyHQ.org:

    You can of course use setjmp & longjmp in C but depending on how many levels >> up you jump they could be more trouble than they're worth. I think I've only >> ever used them once.

    That's makes a lot of work and it's really ugly. And you need global >jump_buf-s for that.

    Its no different to C++ exceptions except obviously no destructors are called so there's no chance to do a tidy up at each stack level. Also jumps arn't limited to lower to higher stack frames jumps, they can jump about all over
    the place. Whether thats useful or not I can't say. I've never needed it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Muttley@DastardlyHQ.org on Sun Jun 8 16:55:50 2025
    Muttley@DastardlyHQ.org writes:
    On Sun, 8 Jun 2025 17:02:08 +0200
    Bonita Montero <Bonita.Montero@gmail.com> wibbled:
    Am 08.06.2025 um 10:55 schrieb Muttley@DastardlyHQ.org:

    You can of course use setjmp & longjmp in C but depending on how many levels
    up you jump they could be more trouble than they're worth. I think I've only
    ever used them once.

    That's makes a lot of work and it's really ugly. And you need global >>jump_buf-s for that.

    Its no different to C++ exceptions except obviously no destructors are called >so there's no chance to do a tidy up at each stack level. Also jumps arn't >limited to lower to higher stack frames jumps, they can jump about all over >the place. Whether thats useful or not I can't say. I've never needed it.


    I've used sigsetjmp/siglongjmp in C++ code, very successfully. As an experiment a few
    years ago, I replaced it with C++ exceptions and took a 20% performance
    hit in the application. Needless to say the experiment was a failure.

    Note that the code in question[*] is performance sensitive and doesn't do dynamic resource allocations (or use STL at all), thus the fact that
    C++ unwinding will execute destructors isn't relevent to this application.

    The primary cause of the performance hit was the extra code generated
    to handle stack unwinding.

    [*] Which models a CPU, longjmp is used when an modeled CPU exception
    (memory fault, arithmetic fault, interrupt, etc) is detected
    to return to the instruction dispatch loop.

    In general, I tend to concur with wij - I prefer to handle run-of-the-mill errors when they're detected.

    For example:

    c_file_card_unit::c_file_card_unit(ulong channel, ulong unit, const char *name,
    c_logger *lp, c_card_dlp *dlp, bool punch,
    bool hollerith, const char *binpath)
    : c_card_unit(channel, unit, lp, dlp, punch)
    {
    int flags = punch?O_RDWR|O_APPEND:O_RDONLY;
    int diag;
    uint8 header[CARD_SIZE_COLUMNS];

    f_file = NULL;
    f_inputhopper = 0ul;
    f_binfd = -1;
    snprintf(f_binary_path, sizeof(f_binary_path), "%s", binpath);

    diag = stat(name, &cu_stat);
    if (diag == -1) {
    if ((errno == ENOENT) && punch) {
    flags |= O_CREAT|O_EXCL;
    }
    }

    cu_fd = open(name, flags, 0600);
    if (cu_fd == -1) {
    fprintf(stdout, "%4.4lu/%2.2lu Unable to open '%s': %s\n",
    cu_channel, cu_unit, name, strerror(errno));
    return;
    }

    diag = fcntl(cu_fd, F_SETFD, FD_CLOEXEC);
    if (diag == -1) {
    lp->log("%4.4lu/%2.2lu Unable to set FD_CLOEXEC on '%s': %s\n",
    cu_channel, cu_unit, name, strerror(errno));
    diag = close(cu_fd);
    cu_fd = -1;
    return;
    }

    ...
    }

    bool
    c_file_card_unit::is_ready(void)
    {
    return (cu_fd != -1) && ((f_file != NULL) && !feof(f_file));
    }

    So, if is_ready() returns false after the constructor runs,
    the creator of the object knows the creation failed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Bonita Montero on Sun Jun 8 16:58:24 2025
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 07.06.2025 um 23:12 schrieb Janis Papanagnou:

    Context, in the general case, matters. ...

    If you need the context then you catch the exception near where
    it is thrown; but that's not usual, meaning in most cases you
    don't need that context. F.e. when a bad_alloc is thown it dosn't
    matter which allocation failed, it's just enough to know that a >memory-collapse happened.

    Actually it very much matters where the allocation failed, if
    one wishes to recover from it. It seems your concept of error
    handling is simply reporting it (hopefully with sufficient
    context information for the user to understand what needs to
    be fixed) and calling exit().

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Scott Lurndal on Sun Jun 8 17:45:47 2025
    On 2025-06-08, Scott Lurndal <scott@slp53.sl.home> wrote:
    Muttley@DastardlyHQ.org writes:
    On Sun, 8 Jun 2025 17:02:08 +0200
    Bonita Montero <Bonita.Montero@gmail.com> wibbled:
    Am 08.06.2025 um 10:55 schrieb Muttley@DastardlyHQ.org:

    You can of course use setjmp & longjmp in C but depending on how many levels
    up you jump they could be more trouble than they're worth. I think I've only
    ever used them once.

    That's makes a lot of work and it's really ugly. And you need global >>>jump_buf-s for that.

    Its no different to C++ exceptions except obviously no destructors are called >>so there's no chance to do a tidy up at each stack level. Also jumps arn't >>limited to lower to higher stack frames jumps, they can jump about all over >>the place. Whether thats useful or not I can't say. I've never needed it.


    I've used sigsetjmp/siglongjmp in C++ code, very successfully. As an experiment a few
    years ago, I replaced it with C++ exceptions and took a 20% performance
    hit in the application. Needless to say the experiment was a failure.

    setjmp and longjmp have a clearly defined implementation model
    (obviously not in ISO C, but so in implementation practice).

    Implementations of setjmp do not stray far from the paradigm of just
    saving a bunch of registers in an array, which are then 'blindly"
    restored.

    This model gives you certain performance characteristics that you can
    rely on. Both saving the state and doing the longjmp are fairly cheap.

    In C++, the tradeoffs are going to be a crapshoot: whether it is
    expensive to set up a try block, but cheap to throw, or vice versa
    and that sort of thing.

    A C++ throw typically has to search for the exit point to which control
    will be transferred. (Maybe not in some statically analyzable cases,
    like throw and catch being all in the same function.)

    In general, I tend to concur with wij - I prefer to handle run-of-the-mill errors when they're detected.

    But errors can't always be handled where they are detected. That's why,
    in the first place, you are receiving the error from the function that
    failed! That function couldn't handle it, so it tossed it upward to you.

    The alternative to exceptions is to detect errors at multiple levels
    and pass up whatever you can't handle.


    For example:

    c_file_card_unit::c_file_card_unit(ulong channel, ulong unit, const char *name,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    OK, this is a constructor.

    So, if is_ready() returns false after the constructor runs,
    the creator of the object knows the creation failed.

    Right, just like the caller of open() knows that creation
    failed, because -1 was returned.

    The error was only partially handled by c_file_card_unit in so far
    is that it ended up in a documented state, which now something
    else has to handle.

    --
    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 Lawrence D'Oliveiro@21:1/5 to Bonita Montero on Mon Jun 9 07:59:05 2025
    On Sun, 8 Jun 2025 10:06:58 +0200, Bonita Montero wrote:

    In C every call level has to deal with erorrs, whereas in C++ only
    one level at the upper edge has to catch the errors.

    Not necessarily that simple. It might be easier if C++ had
    try/finally (like Python does), but it doesn’t.

    Here’s a patch I submitted to the Blender project some years ago to
    fix up their directory-scan code to gracefully recover from errors
    without either memory leaks or double-frees. This code is in C. It’s
    all a matter of structured programming.

    <https://projects.blender.org/blender/blender/src/commit/edf4855a38e3ee24874431f7c6321f04cb6d1b2f>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@DastardlyHQ.org@21:1/5 to All on Mon Jun 9 09:20:30 2025
    On Sun, 8 Jun 2025 17:18:03 +0200
    Bonita Montero <Bonita.Montero@gmail.com> wibbled:
    Am 08.06.2025 um 17:08 schrieb Muttley@DastardlyHQ.org:

    Its no different to C++ exceptions except obviously no destructors
    are called so there's no chance to do a tidy up at each stack level.

    It's much more complicated than exceptions because the functions where
    the error raises and where the error is "caught" need shared global >variables. C++ doesn't need that, just throw and catch and everything
    is glued to the runtime.
    And the problem with your solution is: All functions between the setjmp-
    and the longjmp-calls don't have any cleanup, i.e. they don't handle
    back their opened resources to the runtime or the kernel. With RAII in >combination with exceptions that's for free.
    Do you really think setjmp() / longjmp() is a competitive solution ?
    You're naive.

    Did you actually read what I wrote? Obviously in C++ you'd use exceptions
    but in C without any kind of built in exception mechanism they're better than nothing if you want to jump out of a deep stack.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@DastardlyHQ.org@21:1/5 to All on Mon Jun 9 10:21:42 2025
    On Sun, 08 Jun 2025 16:55:50 GMT
    scott@slp53.sl.home (Scott Lurndal) wibbled:
    In general, I tend to concur with wij - I prefer to handle run-of-the-mill >errors when they're detected.

    Same here. I think with exceptions the clue is in the name. They should really only be used for exceptional circumstances, not as a general minor error handling mechanism.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Bonita Montero on Mon Jun 9 14:01:25 2025
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 08.06.2025 um 18:58 schrieb Scott Lurndal:

    Actually it very much matters where the allocation failed, if
    one wishes to recover from it.

    This very rarely makes sense. It's almost always the case that if
    an operation fails, it doesn't matter what allocation was behind
    it.

    Have you ever written real-world production code? Like an operating
    system, where allocation failures should -never- result in an
    inability to recover.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Bonita Montero on Mon Jun 9 15:53:19 2025
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 09.06.2025 um 16:01 schrieb Scott Lurndal:

    Have you ever written real-world production code? Like an operating
    system, where allocation failures should -never- result in an
    inability to recover.

    If you need an allocation to proceed and it fails you can't recover.

    That's your problem caused by poor design and implementation. Exacerbated
    by the propensity for you to use C++ features that require dynamic
    allocation where other forms of data structures are more suitable.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Bonita Montero on Mon Jun 9 18:33:38 2025
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 09.06.2025 um 17:53 schrieb Scott Lurndal:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 09.06.2025 um 16:01 schrieb Scott Lurndal:

    Have you ever written real-world production code? Like an operating >>>> system, where allocation failures should -never- result in an
    inability to recover.

    If you need an allocation to proceed and it fails you can't recover.

    That's your problem caused by poor design and implementation.

    That's how 100% of all programs that deal with bad_alloc are designed.

    Exacerbated by the propensity for you to use C++ features that require
    dynamic allocation where other forms of data structures are more suitable.

    When dynamic allocation is needed it is needed.

    And there are many ways to handle it that don't include throwing
    bad_alloc when the system is unable to provide additional address
    space, memory or backing store.

    Allocating major data structures at application start (perhaps using a
    pool allocator) and crafting your algorithms such that they
    don't require infinite memory is a good start.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Heathfield@21:1/5 to Scott Lurndal on Mon Jun 9 19:22:03 2025
    On 09/06/2025 16:53, Scott Lurndal wrote:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 09.06.2025 um 16:01 schrieb Scott Lurndal:

    Have you ever written real-world production code? Like an operating
    system, where allocation failures should -never- result in an
    inability to recover.

    If you need an allocation to proceed and it fails you can't recover.

    That's your problem caused by poor design and implementation.

    To be fair, that's how the schools teach them to cut code: if you
    drop a piton, jump off the mountain.

    --
    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 Scott Lurndal on Mon Jun 9 18:59:27 2025
    scott@slp53.sl.home (Scott Lurndal) writes:

    Bonita Montero <Bonita.Montero@gmail.com> writes:

    Am 08.06.2025 um 18:58 schrieb Scott Lurndal:

    Actually it very much matters where the allocation failed, if
    one wishes to recover from it.

    This very rarely makes sense. It's almost always the case that if
    an operation fails, it doesn't matter what allocation was behind
    it.

    Have you ever written real-world production code? Like an operating system, where allocation failures should -never- result in an
    inability to recover.

    You're talking to someone who can't understand the difference
    between comp.lang.c and comp.lang.c++. What do you expect?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@DastardlyHQ.org@21:1/5 to All on Tue Jun 10 07:21:32 2025
    On Mon, 09 Jun 2025 18:33:38 GMT
    scott@slp53.sl.home (Scott Lurndal) wibbled:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 09.06.2025 um 17:53 schrieb Scott Lurndal:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 09.06.2025 um 16:01 schrieb Scott Lurndal:

    Have you ever written real-world production code? Like an operating >>>>> system, where allocation failures should -never- result in an
    inability to recover.

    If you need an allocation to proceed and it fails you can't recover.

    That's your problem caused by poor design and implementation.

    That's how 100% of all programs that deal with bad_alloc are designed.

    Exacerbated by the propensity for you to use C++ features that require
    dynamic allocation where other forms of data structures are more suitable. >>
    When dynamic allocation is needed it is needed.

    And there are many ways to handle it that don't include throwing
    bad_alloc when the system is unable to provide additional address
    space, memory or backing store.

    Allocating major data structures at application start (perhaps using a
    pool allocator) and crafting your algorithms such that they
    don't require infinite memory is a good start.

    Ugh. Then you end up like the Java JVM - grabbing boatloads of memory that causes huge startup delays and can often cause the machine to do lots of swapping and/or slow everything else down to treacle.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Kaz Kylheku on Tue Jun 10 03:21:52 2025
    Kaz Kylheku <643-408-1753@kylheku.com> writes:

    On 2025-06-08, Scott Lurndal <scott@slp53.sl.home> wrote:

    Muttley@DastardlyHQ.org writes:

    On Sun, 8 Jun 2025 17:02:08 +0200
    Bonita Montero <Bonita.Montero@gmail.com> wibbled:

    Am 08.06.2025 um 10:55 schrieb Muttley@DastardlyHQ.org:

    You can of course use setjmp & longjmp in C but depending on how
    many levels up you jump they could be more trouble than they're
    worth. I think I've only ever used them once.

    That's makes a lot of work and it's really ugly. And you need
    global jump_buf-s for that.

    Nonsense.

    [...]

    setjmp and longjmp have a clearly defined implementation model
    (obviously not in ISO C, but so in implementation practice).

    What I think you mean is that setjmp/longjmp have a natural and
    straightforward implementation strategy that works on many
    hardware platforms and in many C implementations. That strategy
    is not ubiquitous, and TTBOMK is not defined anywhere except
    implicitly by the code that implements it. Described perhaps,
    but that isn't the same as a definition.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Muttley@DastardlyHQ.org on Tue Jun 10 13:19:24 2025
    Muttley@DastardlyHQ.org writes:
    On Mon, 09 Jun 2025 18:33:38 GMT
    scott@slp53.sl.home (Scott Lurndal) wibbled:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 09.06.2025 um 17:53 schrieb Scott Lurndal:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 09.06.2025 um 16:01 schrieb Scott Lurndal:

    Have you ever written real-world production code? Like an operating >>>>>> system, where allocation failures should -never- result in an
    inability to recover.

    If you need an allocation to proceed and it fails you can't recover.

    That's your problem caused by poor design and implementation.

    That's how 100% of all programs that deal with bad_alloc are designed.

    Exacerbated by the propensity for you to use C++ features that require >>>> dynamic allocation where other forms of data structures are more suitable. >>>
    When dynamic allocation is needed it is needed.

    And there are many ways to handle it that don't include throwing
    bad_alloc when the system is unable to provide additional address
    space, memory or backing store.

    Allocating major data structures at application start (perhaps using a
    pool allocator) and crafting your algorithms such that they
    don't require infinite memory is a good start.

    Ugh. Then you end up like the Java JVM - grabbing boatloads of memory that >causes huge startup delays and can often cause the machine to do lots of >swapping and/or slow everything else down to treacle.

    That's a problem with host not being suitable for java, if that
    is the behavior you are seeing. I've not seen that in production
    java-based applications that are competently developed.

    For C/C++, one generally allocates page-aligned regions with mmap, eschewing granular allocation methods such as new/delete/malloc.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@DastardlyHQ.org@21:1/5 to All on Tue Jun 10 14:46:28 2025
    On Tue, 10 Jun 2025 13:19:24 GMT
    scott@slp53.sl.home (Scott Lurndal) wibbled:
    Muttley@DastardlyHQ.org writes:
    Ugh. Then you end up like the Java JVM - grabbing boatloads of memory that >>causes huge startup delays and can often cause the machine to do lots of >>swapping and/or slow everything else down to treacle.

    That's a problem with host not being suitable for java, if that
    is the behavior you are seeing. I've not seen that in production
    java-based applications that are competently developed.

    For C/C++, one generally allocates page-aligned regions with mmap, eschewing >granular allocation methods such as new/delete/malloc.

    No, one generally doesn't. Why on earth would anyone bother with their own
    low level memory allocation based on pages unless they were writing something like a database? Plus I'm sure most modern implementations of malloc() are sophisticated enough not to just allocate random blocks of memory but have their own pool behind the scenes which they manage.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Bonita Montero on Tue Jun 10 14:36:04 2025
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 03.06.2025 um 02:37 schrieb Lawrence D'Oliveiro:
    On Mon, 2 Jun 2025 09:35:24 +0200, Bonita Montero wrote:

    Am 01.06.2025 um 09:43 schrieb Lawrence D'Oliveiro:

    On Sun, 1 Jun 2025 07:58:54 +0200, Bonita Montero wrote:

    Sth. like this:

    for( directory_entry const &de : recursive_directory_iterator( "\\", >>>>> directory_options::follow_directory_symlink ) )
    cout << de.path() << endl;

    You need the dirfd functions to avoid certain potential security
    holes on operations with symlinks.

    Which security holes ?

    TOCTOU.

    That's unavoidable with directory-operations.

    Incorrect. The entire purpose of the POSIX *at functions are to close
    those security holes.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Scott Lurndal on Tue Jun 10 07:18:50 2025
    scott@slp53.sl.home (Scott Lurndal) writes:

    [...]

    And all the existing C compilers in the entire planet support
    the C90 dialect[*], if so instructed. Where is the problem?

    It is common to use the word "dialect" when talking about
    different editions of the C standard, but actually it isn't
    right. The word "dialect" comes from linguistics, and it
    has a particular meaning that does not apply in this case.
    My understanding of the terminology used in linguistics is
    that C90, C99, C11, and so forth, should be referred to
    as "varieties" of the C language, in much the same way
    that American English and British English and Indian
    English are all different varieties (rather than dialects)
    of English.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Keith Thompson on Tue Jun 10 08:52:50 2025
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

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

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

    Richard Harnden <richard.harnden@gmail.invalid> writes:

    On 22/05/2025 23:32, Keith Thompson wrote:

    [...]

    In one of your library's headers:
    extern const char ESCAPE;
    In the corresponding *.c file:
    const char ESCAPE = ('z' - 'a' == 25 ? '\x1b' : '\x27');
    Change the name if you prefer.

    Wouldn't that be a reserved identifier?

    Yes, it would. Good catch.

    (Identifiers starting with E followed by either a digit or an
    uppercase letter are reserved; they could be defined as macros
    in <errno.h>.)

    They are reserved only as macros, and only if <errno.h> has
    been #include'd.

    For this particular use, it's easy to make the definition work,
    simply by adding

    #undef ESCAPE

    before the declaration in the header file, and before the
    definition in the source file (assuming of course that if
    there are any #include <errno.h> they precede the #undef's).

    It would be even easier to pick a different name.

    The point of my comment was to help explain the rules about what
    macro names are reserved and under what circumstances, not to
    suggest a way to avoid conflicts.

    A better way to avoid conflicts with E* macros is to take functions
    where errno is needed, as for example signal(), and not call them
    directly but rather wrap each one in a function, with the wrapping
    functions put in (one or more) separate translation unit(s). Those
    translation units, and only those translation units, are the ones
    where a #include <errno.h> is done. Some details are needed to keep
    the separation complete, but I think those aren't too hard to work
    out, so if someone has trouble please ask. This way most of the
    program can use names beginning with E that might otherwise be
    reserved, without any fear of conflicts. There is a bit of source
    code overhead, but that is paid only once, across all projects that
    use this approach. Also there are some other benefits, related to
    libraries used that are not part of ISO C, such as Posix, which
    again should be readily apparent to anyone used to working in large
    projects that use such libraries.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Scott Lurndal on Tue Jun 10 16:52:11 2025
    On 2025-06-10, Scott Lurndal <scott@slp53.sl.home> wrote:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 03.06.2025 um 02:37 schrieb Lawrence D'Oliveiro:
    On Mon, 2 Jun 2025 09:35:24 +0200, Bonita Montero wrote:

    Am 01.06.2025 um 09:43 schrieb Lawrence D'Oliveiro:

    On Sun, 1 Jun 2025 07:58:54 +0200, Bonita Montero wrote:

    Sth. like this:

    for( directory_entry const &de : recursive_directory_iterator( "\\", >>>>>> directory_options::follow_directory_symlink ) )
    cout << de.path() << endl;

    You need the dirfd functions to avoid certain potential security
    holes on operations with symlinks.

    Which security holes ?

    TOCTOU.

    That's unavoidable with directory-operations.

    Incorrect. The entire purpose of the POSIX *at functions are to close
    those security holes.

    Simply by using a path coming from an untrusted input, you have
    a securty problem that no POSIX function addresses.

    I seem to recall that the "at" functions are mainly motivated by multithreading.

    A process has a single working directory, inherited from a time before
    threads. The "at" function can be used to defensively code file system
    access in a thread, even if there is code in the process which uses
    chdir.

    --
    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 Waldek Hebisch@21:1/5 to Scott Lurndal on Tue Jun 10 20:22:29 2025
    Scott Lurndal <scott@slp53.sl.home> wrote:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 09.06.2025 um 17:53 schrieb Scott Lurndal:
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 09.06.2025 um 16:01 schrieb Scott Lurndal:

    Have you ever written real-world production code? Like an operating >>>>> system, where allocation failures should -never- result in an
    inability to recover.

    If you need an allocation to proceed and it fails you can't recover.

    That's your problem caused by poor design and implementation.

    That's how 100% of all programs that deal with bad_alloc are designed.

    Exacerbated by the propensity for you to use C++ features that require
    dynamic allocation where other forms of data structures are more suitable. >>
    When dynamic allocation is needed it is needed.

    And there are many ways to handle it that don't include throwing
    bad_alloc when the system is unable to provide additional address
    space, memory or backing store.

    Allocating major data structures at application start (perhaps using a
    pool allocator) and crafting your algorithms such that they
    don't require infinite memory is a good start.

    If you can allocate memory before looking at data, then you really
    do not need dynamic allocation. And there are cases when you can
    do with something simpler than general dynamic allocation.

    But AFAICS there are cases which need general dynamic allocation.
    And there are cases which strictly speaking do not need general
    dynamic allocation, but dynamic allocation looks better in
    practice. Namely, one can estimate amount of memory that is
    sufficient to do the job, but this estimate is typically
    significantly bigger than amount of memory which would be
    dynamically allocated. In other words, users prefer
    "stochastic" version, that is program which usually is
    efficient, but with low probability may fail or require more
    resources to a "deterministic" program that always
    require more resources.

    There are now in use programs that solve high complexity
    problems. On many practical problems they are quite
    efficient, but by the nature of problem they need
    inpracticaly large resources on some instances. For
    such problem the best one can hope is to localize the
    trouble, that is fail the computation if it requires
    to much, but keep independent things running. And even
    such localized failure may be tricky (that is avoiding
    trouble in unrelated places).

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Keith Thompson on Tue Jun 10 21:34:23 2025
    On 2025-06-10, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    I find the reservation of potential errno macro names annoying.

    If the standard contained /no/ statements about what a given header
    file may reserve, then /any/ identifier whatsoever would be a potential
    clash.

    The errno reservation is kind of good because implementors often extend
    the set of errno constants. POSIX has a lot more of them than ISO C, and
    there are some vendor-specific ones.

    Anyway, you can safely ignore the reservation theatre, and just
    deal with clashes that happen, when they happen. (If you're lucky,
    that could just be never).

    Anyway, ISO C, POSIX and vendors have historically introduced new
    identifiers in spaces that were not previously declared as reserved.
    If you're ever hit by that, you will feel like a completel sucker if
    you've religiously adhered to namespaces from your end.

    --
    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 Lawrence D'Oliveiro@21:1/5 to Bonita Montero on Tue Jun 10 23:33:08 2025
    On Tue, 10 Jun 2025 14:07:40 +0200, Bonita Montero wrote:

    Am 03.06.2025 um 02:37 schrieb Lawrence D'Oliveiro:

    On Mon, 2 Jun 2025 09:35:24 +0200, Bonita Montero wrote:

    Am 01.06.2025 um 09:43 schrieb Lawrence D'Oliveiro:

    On Sun, 1 Jun 2025 07:58:54 +0200, Bonita Montero wrote:

    Sth. like this:

    for( directory_entry const &de : recursive_directory_iterator( "\
    \",
    directory_options::follow_directory_symlink ) )
    cout << de.path() << endl;

    You need the dirfd functions to avoid certain potential security
    holes on operations with symlinks.

    Which security holes ?

    TOCTOU.

    That's unavoidable with directory-operations.

    No it isn’t. That’s why we have the fd-based calls in recent POSIX, and in Linux. That plugs the holes, and makes it possible to implement privileged file-access software like Samba securely.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Keith Thompson on Wed Jun 11 01:16:11 2025
    On 2025-06-10, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    On 2025-06-10, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    I find the reservation of potential errno macro names annoying.

    If the standard contained /no/ statements about what a given header
    file may reserve, then /any/ identifier whatsoever would be a potential
    clash.

    The errno reservation is kind of good because implementors often extend
    the set of errno constants. POSIX has a lot more of them than ISO C, and
    there are some vendor-specific ones.

    Anyway, you can safely ignore the reservation theatre, and just
    deal with clashes that happen, when they happen. (If you're lucky,
    that could just be never).

    You can do that, but a new clash could happen when your code is
    compiled on a system that defines an errno macro that you haven't
    seen before.

    A new CRASH could happen too, and any number of things.

    This clash would be literally one of the first roadblocks, if not the
    first one, that we would see when just exploring the possibility whether
    our code might not run on that system.

    At that point we could be months away from declaring that a supported
    platform.


    Anyway, ISO C, POSIX and vendors have historically introduced new
    identifiers in spaces that were not previously declared as reserved.
    If you're ever hit by that, you will feel like a completel sucker if
    you've religiously adhered to namespaces from your end.

    Yes, that can happen, but no, I won't feel like a complete sucker.

    If I define my own strfoo() function and a new edition of the standard defines strfoo() in <string.h>, the clash is my fault,and I could have avoided it by defining str_foo().

    But, my point is, that maybe you could have called it kidneybeans() and
    still have a clash.

    In fact, if you are writing new string functions that are the same sort
    of stuff like the standard ones, you should use the str prefix,
    for consistency.

    If your code is influential enough, they might be standardized one
    day---and then they are ready with the proper naming, so early adopters
    of your functions won't have to change anything; just in their build
    system drop the third party code and switch to what their library now
    provides.


    --
    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 Lawrence D'Oliveiro@21:1/5 to Bonita Montero on Wed Jun 11 05:34:59 2025
    On Wed, 11 Jun 2025 07:07:37 +0200, Bonita Montero wrote:

    Am 11.06.2025 um 01:33 schrieb Lawrence D'Oliveiro:

    No it isn’t. That’s why we have the fd-based calls in recent POSIX, and >> in Linux. That plugs the holes, and makes it possible to implement
    privileged file-access software like Samba securely.

    opendir() and readdir() hasn't changed for decades.

    And they are not enough.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Bonita Montero on Wed Jun 11 13:41:11 2025
    Bonita Montero <Bonita.Montero@gmail.com> writes:
    Am 11.06.2025 um 01:33 schrieb Lawrence D'Oliveiro:

    No it isn’t. That’s why we have the fd-based calls in recent POSIX, and in
    Linux. That plugs the holes, and makes it possible to implement privileged >> file-access software like Samba securely.

    opendir() and readdir() hasn't changed for decades.


    That turns out to not be true. fdopendir(3) was added in Issue
    7 of the Single Unix Specification (aka POSIX).

    https://pubs.opengroup.org/onlinepubs/9799919799/functions/fdopendir.html

    ftw(3)/nftw(3) are used more often than opendir(3) in real world code.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Keith Thompson on Wed Jun 11 15:32:06 2025
    On 2025-06-10, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    I find the reservation of potential errno macro names annoying.

    Perhaps more annoying is the idea that all _t typedef names are reserved
    by POSIX.

    But, you have to look at it from a different point of view. POSIX
    essentially says that when it introduces types names, they will stick a
    _t suffix on them. I.e. that they will conform with a common practice.
    This is good! We want that!

    That doesn't mean everyone should panic and abandon the same good
    practice.

    Suppose two computer philosophers live on separate islands and are
    thinking of what to name a type. One comes up with "foo" and the
    other with "bar". If they meet and integrate their code, there will
    not be a clash.

    Now suppose that they are conscious of conventions; because they
    are naming a type, they both add "_t".

    That, ipso facto, is not going to *introduce* a clash!

    Everyone adding a common suffix to a class of identifiers will
    not introduce clashes in that class. Likewise, removing a common suffix
    will not introduce a clash.

    Now sure, if organization A uses _t, and B entirely avoids it, their
    type names cannot clash; velvet_underground and velvet_underground_t
    are distinct. But that's a bad reading of the situation.

    I want types in C programs to have _t whether they are coming
    from POSIX, third party vendors, or the local code base.

    --
    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 Kaz Kylheku@21:1/5 to Keith Thompson on Wed Jun 11 15:23:16 2025
    On 2025-06-11, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    On 2025-06-10, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    On 2025-06-10, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    I find the reservation of potential errno macro names annoying.

    If the standard contained /no/ statements about what a given header
    file may reserve, then /any/ identifier whatsoever would be a potential >>>> clash.

    The errno reservation is kind of good because implementors often extend >>>> the set of errno constants. POSIX has a lot more of them than ISO C, and >>>> there are some vendor-specific ones.

    Anyway, you can safely ignore the reservation theatre, and just
    deal with clashes that happen, when they happen. (If you're lucky,
    that could just be never).

    You can do that, but a new clash could happen when your code is
    compiled on a system that defines an errno macro that you haven't
    seen before.

    A new CRASH could happen too, and any number of things.

    Sure, but a compilation failure is more likely.

    This clash would be literally one of the first roadblocks, if not the
    first one, that we would see when just exploring the possibility whether
    our code might not run on that system.

    At that point we could be months away from declaring that a supported
    platform.

    Sure, but why not skip that first roadblock?

    Because:

    1. The roadblock is not a sure thing; in fact it is improbable.

    2. The severity/impact is trivial.

    3. There are dowsides to skipping it:

    - tiny amount of effort, which occurs with 100% probability.

    - giving up a desired name.

    Anyway, ISO C, POSIX and vendors have historically introduced new
    identifiers in spaces that were not previously declared as reserved.
    If you're ever hit by that, you will feel like a completel sucker if
    you've religiously adhered to namespaces from your end.

    Yes, that can happen, but no, I won't feel like a complete sucker.

    If I define my own strfoo() function and a new edition of the standard
    defines strfoo() in <string.h>, the clash is my fault,and I could have
    avoided it by defining str_foo().

    But, my point is, that maybe you could have called it kidneybeans() and
    still have a clash.

    Certainly, I've already acknowledged that.

    But surely an identifier that the standard says is reserved is less
    likely to cause a clash than one that isn't.

    The probabilities are not precisely quantified, but low.

    The probability that your #define ELMER_FUDD will clash with something
    out of <errno.h> is vanishingly low, as is the probability that #define BUGS_BUNNY will clash with something in spite of not intruding into
    a reserved namespace.

    We have no way to quantitfy the probabilities, and they are so low that
    even if one could be determined to be 100 times the other, why
    prioritize the concern over that difference over any other naming consideration? (Like that maybe Looney Tunes characters aren't very good

    In fact, if you are writing new string functions that are the same sort
    of stuff like the standard ones, you should use the str prefix,
    for consistency.

    If your code is influential enough, they might be standardized one
    day---and then they are ready with the proper naming, so early adopters
    of your functions won't have to change anything; just in their build
    system drop the third party code and switch to what their library now
    provides.

    I see your point, but ... meh. To me, a name matching "str[a-z]*"
    fairly strongly suggests a function declared in <string.h> in ISO C.
    Of course it's not an absolute rule; see strlcpy(), for example
    (which is now part of POSIX).

    Note that the guys who made strlcpy did (almost) exactly what I say
    above. They deliberately introduced the function into that namespace,
    which made it more nicely 'standardizable". I say almost because they
    are systems implementors working on OpenBSD, and so they are using the namespace as designed. However, the use of those functions spread beyond OpenBSD; application codebases started defining those for themselves.

    Even a str*() identifier that never clashes with ISO C's <string.h>
    can still clash with POSIX, or glibc, or BSD, or ....

    I would have been happier if POSIX were less intrusive on the
    C standard library, but the way C and POSIX evolved didn't make
    that feasible.

    But POSIX has to use *some* kind of names. No matter what you call a
    function, it's going to start with either an underscore, or an upper or
    lower case letter. So if it doesn't intrude into the _* space, it will
    intrude into a*. Or else if not into that one, then b*, ... and so on. Everything is in some space, and could step on something in an
    application.

    Religiously sticking to certain spaces can uglify the API. Imagine
    everything newer than 1990 in POSIX were called posix_<something>.
    Yuck! (The whole pthread_* thing is actually curious that way).

    Namespaces offer a solution. They are not available in C, and in many
    ways are a solution in search of a problem.

    It's amazing how far C development is going, into code bases of millions
    of lines and even orders of magnitude more, without a package system.

    What helps is that there are no clashes between:

    - static symbols in separate translation units.
    - symbols in separate programs
    - unexported symbols among shared libraries

    It's also amazing how just even a small naming convention reduces
    the occurrences of clashes. E.g. four letter prefix of your company's
    acronym, and you're mostly good. Writing code for Broadcom? Just
    call things brcm_*.

    Speaking of POSIX, again, if you use ALL_CAPS variable names in shell
    scripts, Makefiles, or your environment you are in treading in reserved namespace! Yet everyone deos this all the time and the sky does not
    fall.

    Just because POSIX says that it will not define lower-cased environment varaibles doesn't mean everyone should rush to define their own
    variables there.

    The "user" and "vendor" roles can be fluid. You might define a
    lower cased environment variable, thinking you are a user, in order not
    to clash with vendors. Next thing you know, you have users who are
    buying a complete system solution for you, including your app with
    lower-cased environment variables. You're now "vendor" and doing it
    wrong.

    --
    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 Lawrence D'Oliveiro@21:1/5 to Bonita Montero on Thu Jun 12 01:33:18 2025
    On Wed, 11 Jun 2025 17:33:21 +0200, Bonita Montero wrote:

    [fdopendir] doesn't make a difference for the discussed point.

    It’s a key part of the defence against symlink-related vulnerabilities.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Richard Heathfield on Wed Jun 11 20:15:26 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 28/05/2025 13:41, Tim Rentsch wrote:

    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 24/05/2025 06:32, Tim Rentsch wrote:

    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 23/05/2025 13:43, Tim Rentsch wrote:

    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 20/05/2025 10:18, Keith Thompson wrote:

    C90 will never be extended.

    And for that reason it will always be valuable. Stability
    has a value all its own.

    C99 is just as stable as C90, and has been for well over a
    decade.

    Sure, but it's a different stable.

    If it were the same stable, it would be C90.

    C99 isn't C90, therefore it isn't the same stable.

    If you tell me C99 is a rock, I will not doubt you. But the C90
    rock it most certainly isn't.

    Now you're being silly.

    No, sir. If you want to play that game, you can play it with
    yourself. I know that you are perfectly capable of polite
    conversation, so I see no reason to endure the opposite.

    I don't think I'm being impolite.

    Then we are again in disagreement, and it seems obvious that it would
    be foolishly optimistic of me to expect to be able to resolve the
    matter. I'll tell Thunderbird to leave it there.

    Apparently my words were taken with a meaning I didn't intend.
    I'm sorry that this happened.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Richard Heathfield on Tue Jul 1 10:09:11 2025
    Richard Heathfield <rjh@cpax.org.uk> writes:

    On 30/05/2025 10:20, David Brown wrote:

    On 29/05/2025 14:38, Richard Heathfield wrote:

    This really is a very simple point, but perhaps a simple analogy
    will help to clarify it. You don't throw out your 3/4" just
    because you've bought a 19mm. There is room for both in the
    toolbox, and why write 3/4" on your new spanner? It /isn't/ a
    3/4" spanner even though it's very like it, so why pretend
    otherwise?

    Your analogy does not cover C99 vs C90.

    It does if we can construct a program that is legal C90 but not
    legal C99, which is easy enough, or (slightly harder but still not
    that hard) a program that is legal in both dialects but which
    gives different output under C99 than it does for C90.

    $ cat c9099.c; \
    gcc -W -Wall -ansi -pedantic -o c90 c9099.c; \
    gcc -o c99 c9099.c; \
    ./c90; \
    ./c99
    #include <stdio.h>

    int main(void)
    {
    int a = 42;

    int b = a //* comment */ 6;
    ;
    printf("Soln = %d\n", b);

    return 0;
    }
    Soln = 7
    Soln = 42

    It's a straightfoward exercise to write a program that discovers
    whether a given .c file has this potential ambiguity. Of course,
    essentially no actual source code will, but the point is the
    problem is easy to detect, and also correct.

    This observation suggests a related question. Is there a source
    of potential ambiguity between C90 and C99 that is not so easy to
    detect and correct? I can think of one, but it falls into the
    realm of depending on implementation-specific behavior, so could
    just as easily be seen as a portability issue rather than a
    language version issue.

    Obviously it's a contrived example, but then examples pointing out
    the consequences of language differences invariably are.

    Some are. Some are not. In the case of C90 and C99, probably
    all such cases are contrived, but certainly for other language
    pairs there are cases that might arise unintentionally, even for
    similar languages (notably C and C++).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jakob Bohm@21:1/5 to Paul Edwards on Sun Aug 17 21:04:11 2025
    On 2025-05-21 12:00, Paul Edwards wrote:
    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:100jhor$2lgt3$4@dont-email.me...
    On Wed, 21 May 2025 10:23:27 +1000, Paul Edwards wrote:

    ...

    The C90 standard deferred to MVS - probably still does -
    and says that you can't open a file as "w", then read it as
    "rb" and write (a new file) as "wb", and still access (the
    new file) with "r".

    I was shocked when I saw IBM's C library lose the newlines
    when I did the above, and went to look at the standard to
    show that IBM was violating C90 - but it turns out they
    weren't.

    That sort of means you can't write a "zip" program portably,
    against the theoretical C90 file system. Or you would have
    to have flags to say which files need to be opened as text
    or binary.


    I believe the Info-Zip group's ZIP program overcame this problem, by
    somehow enhancing the same feature that handles the difference between
    line endings on UNIX (LF), CP/M (CRLF) and MacOsClassic (CR), but I
    haven't checked .

    Also, the file system peculiarity is probably the same one I experienced
    when transferring some of my old work from VM/CMS to MS-DOS decades ago.

    I do not agree with IBM's C library, and PDPCLIB does
    not have that behavior, so that constraint could potentially
    be dropped in a C90+ standard.

    BFN. Paul.




    Enjoy

    Jakob

    --
    Jakob Bohm, MSc.Eng., I speak only for myself, not my company
    This public discussion message is non-binding and may contain errors
    All trademarks and other things belong to their owners, if any.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jakob Bohm@21:1/5 to Keith Thompson on Sun Aug 17 22:34:30 2025
    On 2025-05-22 07:14, Keith Thompson wrote:
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    On Thu, 22 May 2025 02:20:36 +0200, Jakob Bohm wrote:
    The later UNIX-like file system NTFS ...

    It was (and is) hard to describe NTFS as “Unix-like”. Yes, it had
    hierarchical directories and long(ish) file names, but not much else.
    Drive letters were inherited (indirectly) from DEC OSes, of all things,
    along with an insistence on having filename extensions, restrictions on
    characters allowed in names etc.

    I consider NTFS UNIX-like because it is built around inodes (called MFT entries) and inode numbers, with no inherent special treatment of MSDOS metacharacters in the fundamental logic, except the few places that
    parse user supplied path strings such as symlink targets or passed
    through path strings from API calls .

    When the CP/M style directory listing operations are done on an NTFS
    directory, the NTFS code loads the file names and inode number from the directory storage, then checks the inode to fill in details such as
    MS-DOS file attributes and POSIX-style time stamps (using 64 bit time
    since 1600-01-01 00:00:00 GMT), next the user mode API logic converts
    filenames to the locale character set, discards the unwanted time stamps
    and convert the rest to the API encoding (which may be MS-DOS API locale
    time since 1980 or POSIX time since 1970 or Win32 FILETIME which is same
    as NTFS time).


    I don't believe that NTFS requires filename extensions.
    My understanding is that a file name is stored as a single string
    (with some restrictions).

    Symlinks were not even added until Windows Vista. And you have to have
    special privileges to create them.


    The mechanism for symlinks (NTFS reparse points) was included from the
    start, but exposure of that to user mode was always limited . I'm
    unsure if the crippled POSIX subsystem in the NT 3.10 release included
    symlinks or only hardlinks .


    Enjoy

    Jakob

    --
    Jakob Bohm, MSc.Eng., I speak only for myself, not my company
    This public discussion message is non-binding and may contain errors
    All trademarks and other things belong to their owners, if any.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Paul Edwards on Mon Aug 18 00:30:35 2025
    On 2025-05-21, Paul Edwards <mutazilah@gmail.com> wrote:
    Do note one more thing.

    The C90 standard deferred to MVS - probably still does -
    and says that you can't open a file as "w", then read it as
    "rb" and write (a new file) as "wb", and still access (the
    new file) with "r".

    You mean:

    - write a text file, close it; then
    - open it as a binary file and copy the bytes to another, new binary file; and - finally, read the new binary file in text mode?

    I don't see how that would be allowed to lose any newlines.

    You made a bitwise copy of the file.

    The worst thing that can happen is this: stdio implementations are not
    required to keep the exact length of a binary file down to a byte.

    Binary files can be rounded up and have padding bytes at the end.

    E.g. you write 37 byte, but the file ends up 256 bytes long.

    If an implementation has this issue, it probably will still represent
    text files in such a way that when you copy a binary file, including
    any gratuitous padding, the text file will come out right.

    A recent draft of ISO C says "A binary stream is an ordered sequence of characters that can transparently record internal data. Data read in
    from a binary stream shall compare equal to the data that were earlier
    written out to that stream, under the same implementation. Such a stream
    may, however, have an implementation- defined number of null characters appended to the end of the stream."

    I have C90 somewhere, I can look that up too, but I suspect it was
    the same.

    I was shocked when I saw IBM's C library lose the newlines
    when I did the above, and went to look at the standard to
    show that IBM was violating C90 - but it turns out they
    weren't.

    Losing the newlines in the above scenario (bit copy made of text
    file as a binary file) makes no sense.

    If it is true, someone went out of their way to fuck up something
    simple. (IBM would never do that, right?)

    If we copy a text file as binary and newlines change it suggests that
    the implementation is falling afoul of the "binary stream is an
    ordered sequence of characters that can transparently record
    internal data".

    That sort of means you can't write a "zip" program portably,
    against the theoretical C90 file system.

    Or you would have
    to have flags to say which files need to be opened as text
    or binary.

    This is probably a good idea anyway; you don't want to be compressing
    the proprietary-format binary images of text files, if they are to
    decompress correctly on another system.

    --
    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 James Kuyper@21:1/5 to Kaz Kylheku on Tue Aug 19 18:09:48 2025
    On 2025-08-17 20:30, Kaz Kylheku wrote:
    On 2025-05-21, Paul Edwards <mutazilah@gmail.com> wrote:
    Do note one more thing.

    The C90 standard deferred to MVS - probably still does -
    and says that you can't open a file as "w", then read it as
    "rb" and write (a new file) as "wb", and still access (the
    new file) with "r".

    You mean:

    - write a text file, close it; then
    - open it as a binary file and copy the bytes to another, new binary file; and
    - finally, read the new binary file in text mode?

    I don't see how that would be allowed to lose any newlines.

    You made a bitwise copy of the file.
    ...
    A recent draft of ISO C says "A binary stream is an ordered sequence of characters that can transparently record internal data. Data read in
    from a binary stream shall compare equal to the data that were earlier written out to that stream, under the same implementation. Such a stream
    may, however, have an implementation- defined number of null characters appended to the end of the stream."

    I have C90 somewhere, I can look that up too, but I suspect it was
    the same.

    It was.

    This can interact with text mode, if the representation of new-lines in
    text mode involves null characters. I know of two different ways that
    have actually been used where this could be a problem. One method uses
    null characters to represent a single new-line. The other method stores
    lines in fixed-length blocks, with the end of a line indicated by
    padding to the end of the block with null characters. Either way, the
    padding bytes that may be added in binary mode could be interpreted as
    extra newlines in text mode. That does not match Paul's problem:

    I was shocked when I saw IBM's C library lose the newlines
    when I did the above, and went to look at the standard to
    show that IBM was violating C90 - but it turns out they
    weren't.

    It would help if Paul would identify the clauses from C90 that he
    interpreted as permitting such behavior.

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