• encapsulating directory operations

    From Paul Edwards@3:633/280.2 to All on Tue May 20 16:06:19 2025
    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!")?

    Thanks. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Tue May 20 17: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Tue May 20 19:18:54 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.

    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.

    C90, like all later standards, supports file operations only in hosted implementations, not in freestanding implementations. Even on a
    conforming hosted implementation, every call to fopen() could fail.

    [...]

    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.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Tue May 20 19:33:18 2025
    "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.

    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.

    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.

    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.

    If you wish, you can quibble and say "oh, modern IBM mainframes
    support this bolted on system that has hierarchical directories". But
    you can say that about anything. The Commodore 64 supports a
    hierarchical directory system if you bolt on the same thing that
    an IBM mainframe bolts on too.

    Ironically, the Commodore 64 really does have bolted on system
    that supports a hierarchical directory system - a CMD hard drive.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Tue May 20 19: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Tue May 20 19:36:06 2025
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87ecwj1vy9.fsf@nosuchdomain.example.com...
    "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.

    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.

    C90, like all later standards, supports file operations only in hosted implementations, not in freestanding implementations. Even on a
    conforming hosted implementation, every call to fopen() could fail.

    Sure. I'm talking about hosted implementations where you can
    make fopen do something other than permanently fail.

    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.

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

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Tue May 20 19:45:47 2025
    "Richard Heathfield" <rjh@cpax.org.uk> wrote in message news:100hi99$260c5$1@dont-email.me...
    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.

    Yeah, well said.

    I've been working with C90 for almost 40 years.

    Maybe I'm a slow learner, but so far I haven't seen anything
    wrong with it. It's good enough to write an entire OS and
    supporting tools - quibbling aside.

    Maybe in the next 40 years I will learn enough about languages
    that I can see why it so desperately needs a revamp as per
    C99 etc.

    In the meantime, I'm more interested in solving this problem
    that someone else wrote about:

    https://www.quora.com/Why-did-you-leave-a-job-as-a-software-engineer/answer/ Jeff-Sturm-2

    (I had a similar complaint, but never wrote it down or had the
    ability to express it as well as this guy did).

    The problems in the IT industry aren't going to be solved by
    a new version of ISO C that supports edge-triggered, pre
    and post-emptive multi-hyper-threaded apps with parallel
    predictive circularly-redundant cyber-stalked channel-driven
    variables or whatever they're peddling these days.

    They're going to be solved by people actually understanding
    the systems they support. And understanding some other
    very very basic stuff. Like even understanding the definition
    of "broken". "No-one else (that I've spoken to in the last
    5 minutes) is complaining" is not the definition of "working fine".
    Nor is "the IT department didn't inform us of any outage".

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Tue May 20 21: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Tue May 20 22: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Tue May 20 23:47:01 2025
    "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.

    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.

    But I have a different opinion.

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

    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.

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

    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.

    I understand where these people are coming from.

    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.

    (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.

    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.

    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).

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Tue May 20 23: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Tue May 20 23: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 00: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Muttley@DastardlyHQ.org@3:633/280.2 to All on Wed May 21 00: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 00:12:54 2025
    "Kaz Kylheku" <643-408-1753@kylheku.com> wrote in message news:20250520065158.709@kylheku.com...
    On 2025-05-20, Paul Edwards <mutazilah@gmail.com> wrote:
    The folder routines will do everything I need.

    Except be written in C90?

    Yes - because it is not possible to write them in C90.

    Sort of.

    C90 doesn't explicitly prohibit the fopen and manipulations
    I envisaged.

    But nor does it endorse it.

    I can make my own C library (PDPCLIB) do it.

    But that doesn't have any weight with other C library authors.

    I don't necessarily care about other C library authors.

    But I'm not ruling out caring.

    That's why I'm after technical guidance. Are there some
    underlying principles at play here?

    I'm not really expecting the zmodem protocol to be part
    of C90, even though I can implement it on a stream - at
    least under the right conditions.

    So is it right to expect directories to be covered by C90?

    (I'm not saying I do or don't have that expectation).

    I'm asking the question, not making statements (in this
    sub-instance).

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 00:15:44 2025
    <Muttley@DastardlyHQ.org> wrote in message news:100i2fe$290u1$1@dont-email.me...
    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.

    And I can write code I wrote that complied with the ANSI 89
    draft available circa 1987 on Windows 10.

    I can't run Windows 11 on the computer I smuggled out of
    Communist China (with Zhaoxin processor).

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 00: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 00:48:28 2025
    "Richard Heathfield" <rjh@cpax.org.uk> wrote in message news:100i26d$28ksr$1@dont-email.me...
    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.

    My main development machine/environment is Windows 2000
    which I run under Virtualbox currently (under Windows 10
    currently, but previously Linux), but did at one point run
    on a Pinebook Pro (ARM64).

    Windows 2000 was the last version to not require "activation".

    It also runs OS/2 1.0 programs.

    I don't deny it access to the internet - and in fact, this message
    is coming to you directly from the Windows 2000 system
    running Outlook Express.

    I can't connect to many sites though. But that in itself is a
    warning to not rely on the internet as you know it being
    perpetual. Enron suddenly collapsed without warning too.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 01: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 01:11:27 2025
    "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. :-)

    ISO C90 didn't do that.

    And yes, I counted it on my fingers.

    I suspect Jean-Marc chose "folder" because every man
    and his dog has a directory-processing "standard" and
    he could see that none of them were doing what I wanted
    and I was struggling to express myself.

    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.

    Oh - I guess in that light, he is indeed correct. English is
    *defined* by common usage, so yes, the definition of C
    is thus the latest and greatest standard, regardless of
    whether there are any compilers at all that support that
    language.

    The world is a joke.

    I've already given someone else's take on that. I just
    agree with him.

    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? I also use Microsoft C 6.0 which was the
    last version to run on a PC XT in 640 KiB.

    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.

    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.

    Certainly great to have company!

    (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;

    EXACTLY.

    (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.

    Oh my goodness.

    No, no. I'm not expecting that.

    You can call it C25 if you want. And C25 is a slight change from C90.

    Or C90+

    Or possibly C90+- if say gets() is removed.

    And other things - like things that SubC is struggling to provide -
    could potentially be removed to have multiple "levels" of "minus".

    The SQL standard I read in the 1990s had 3 levels.

    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.)

    I can publish lots of libraries for lots of applications.

    This wouldn't be one of those.

    This would be something fundamental for a portable lingua franca.

    I've mentioned before about adding a define for:

    #define ESC_STR "\x1b"
    #define ESC_CHAR 0x1b

    ready for recompiling on an EBCDIC machine to support an
    EBCDIC ANSI X3.64 terminal.

    So this is another one of those. A portable way of dealing with
    a hierarchical file system. Even on a system like MVS/TSO
    that doesn't have such a thing, so needs some cautionary
    wording.

    C90 is full of cautionary wording and a joy to read.

    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"?

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 01:28:39 2025
    "Richard Heathfield" <rjh@cpax.org.uk> wrote in message news:100i5hm$29du3$2@dont-email.me...
    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?

    It's also capable of running Visual Studio 2005, which means
    I can target x64 processors, even though I can't run the
    executables themselves. Although I will normally use cc64
    as my x64 compiler, which I can also run as a 32-bit program.
    I expect to investigate mm64 one day, but still have other
    priorities.

    I don't often need to run x64 executables, but when I do, I
    copy them to my Windows 10 system, that Windows 2000
    is running under.

    And here are my size constraints:

    2025-05-14 06:15 AM 20,401,095,168 win2000.vhd
    2025-05-14 06:15 AM 19,327,353,344 pauldata.vhd

    I think my Pinebook Pro was 64 GB storage.

    If I give up Visual Studio 2005, I can reduce the win2k
    down to about 4 GB I think, meaning I can cope with
    a 32 GB storage machine.

    Note that the VHD can be mounted on Windows 10
    natively, but I don't currently need to do that. I instead
    have a shared folder c:\w2kshare on my Windows 10
    system, and something from Virtualbox installed on
    the w2k system so that I have a Z drive.

    I'm officially "apocalypse-ready". The Zhaoxin processor
    will make me Last Man Standing if I backed the wrong
    horse.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 01: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Wed May 21 02: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 02: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Wed May 21 02: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Wed May 21 02:58:09 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 03: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Wed May 21 03: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 03: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Wed May 21 03:48:44 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Wed May 21 03:51:08 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 04: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 04: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Wed May 21 05: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 07:15:03 2025
    "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.

    In this case it wasn't really necessary, but I wanted to be
    precise anyway.

    The main reason I use it is because I copied off someone
    else (Gerhard, who wrote most of mvssupa.asm), when he
    started using it.

    Similarly, "BFN" was popular when I started using BBSes,
    and I copied the others. It seems that as soon as I started
    using it, everyone else stopped using it to the point where
    many people have never seen it before I turn up.

    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 !

    Yeah - exactly.

    That's sort of my goal.

    But I am already preempting the fact that the ISO committee
    is very unlikely to cooperate with me, so I will fork the
    standard.

    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;

    That's changing the language. I'm not talking about changing
    the language. There are precedence operators that should
    ideally be changed too.

    Maybe a new language with all these things sorted out
    could be done one day. English could be revamped (or
    replaced with Esperanto) too. But that's not what I'm
    trying to do right now. And is not my question.

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

    I'm guessing what this is, and this sounds like you want
    some new functions. You can have some new functions
    like a variant of strncpy that puts the terminating NUL
    for you too. And snprintf too.

    I'm not trying to do that. I'm after minimal changes to C90.

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

    This is something that sounds good, but I'm not sure C90
    is the right place for it. C90 covers simple applications
    that block on every operation.

    If you want to extend C90 to including fancy non-blocking,
    that's fine, but a different extension to what I'm currently after.

    Note that I did previously suggest the addition of an "fpeek",
    to give a very minimal way of doing minimal non-blocking.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 07:41:12 2025
    "David Brown" <david.brown@hesbynett.no> wrote in message news:100ia33$2ae8t$1@dont-email.me...

    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.

    Kaz has answered all of these questions to my satisfaction,
    so I won't add anything further.

    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.

    What do you mean?

    I was told non-stop that it was "my fault" that I needed
    more than the 16 MiB that was addressable by a S/370
    and that I should "fix" "my" compiler. I was instead
    "fixing" the architecture so that gcc could operate without
    code changes.

    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.

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

    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.

    He probably wouldn't disapprove of Rust being created either.

    But I've actually seen Rust. No way this is a replacement for
    assembler.

    C I see as a replacement for assembler.

    Anything past C90 is just pie in the sky let's add the kitchen
    sink too and an abomination too.

    If I saw people coding int_fast32_t instead of int32_t, it
    would have some passing resemblance to C90.

    It isn't remotely a passing resemblence.

    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.

    No it isn't. Because then it becomes a too-high bar for
    compiler vendors and library vendors and the computers
    themselves to reach.

    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!

    Competing with ISO is not difficult.

    Defeating ISO is the ambitious thing. I didn't say I was trying
    to win the competition. I'm not specifically saying I don't
    want to win though. Note that I am also attempting to become
    the US president, without being an American citizen or even
    going to America. People keep saying it is impossible, because
    the rules say xyz, and I point out how the rules also say I can
    hold a Convention of the States to change those rules - all I
    need is a fairly uniform 51% support of the American people,
    and wait a few years for the appropriate elections, and it will
    happen.

    I didn't say that I'm expecting to get that 51%. But nor did
    Trump get that in 2020. That's always been the challenge - 51%.

    I'm also trying to become Chancellor of Germany without
    going to Germany or learning German.

    Not expecting to win that one either. But there's nothing
    physically stopping me from trying.

    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,

    That's not possible. There is no such concept in C90. That's
    the problem.

    and dropped the bizarre doomsday philosophy.

    That's a joke.

    Choose C90 for
    maximal portability, or personal preference - that's fine. Trying to convince other people that C90 is somehow "perfect"

    I don't think I made that claim.

    while C99 is a
    "complete and utter joke" is not going to get you much technical help.

    I don't see what bearing my opinion on C99 (or politics,
    or anything) has on a technical discussion of C90, but
    so be it.

    Telling us that you are doing all this to be "apocalypse-ready" simply
    brands you as a delusional nutcase.

    I personally don't care if I'm talking to Pol Pot himself.

    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.

    Sounds like some people are easily distracted. I just snip
    the bits that I'm not interested in.

    Same as any debate anywhere. And verbal discussions too.
    I don't really care if people swear at me. I first parse their
    sentence into ASCII text (so that I can continue the
    discussion online without interruption), strip out swearing etc,
    scanning for a technical point.

    And when the technical counter-arguments reach zero bytes,
    I laugh. Works for me. I do an OOB check before any
    part of the conversation becomes face to face though. And
    if the OOB isn't in my favor I tell them to take it online, so
    that my style of argument doesn't need to change.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Wed May 21 07:41:55 2025
    "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?

    There is an existing secondary standard that does provide support
    for directories, among a lot of other things. POSIX. If I wanted
    a system that was based on C90 and could handle directories,
    I can't think of a good reason not to use C90+POSIX. (You might
    have ideological reasons to insist on an earlier edition of POSIX.)

    (MS Windows does not directly support POSIX, or at least does not
    do so usefully, but my impression is that you don't care about that.)

    If you want to define your own language based on C90, you're free
    to do so. You've talked about "extending" C90. Some people here
    have interpreted that to mean you want to change what C90 is, so
    there's something called "C90" that includes some stuff you've added.
    Calling your language "C90" will cause confusion and some anger.
    But you can do exactly the same thing by defining a *new* language
    *with a different name* that's based on C90 with whatever additions
    you want. The name can even start with "C", just as "C++" does.
    Many of us think that would be a waste of time, but it's not our
    time that's being wasted.

    And if you want your new language to support directory operations,
    my advice would be to incorporate POSIX directory operations into
    your new language's standard library.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 07:51:11 2025
    "Scott Lurndal" <scott@slp53.sl.home> wrote in message news:Bw2XP.723747$ujgb.472396@fx15.iad...
    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.

    Your definition of "troll" appears to be "anyone who disagrees
    with your lies".

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

    That's a complete and utter lie.

    I said no such thing about any operating system at all, including my own.
    I've actually said the exact opposite about my own OS - "PDOS isn't
    meant to be the last word on operating systems - it is meant to make
    available a minimal, public domain, C90, 'starter system'".

    I don't use either MSDOS or PDOS for my daily work. I use Windows 2000
    and Windows 10.

    I occasionally fire up all of MSDOS, Freedos, Kylin Linux, ArcaOS
    in a VM to run some tests.

    Also PDOS/386 gets exercised when I do a new release, which gets
    run under qemu (using emulation, so takes about 30 minutes). I don't
    actually use it unless you count typing in "misc\final" and "poweroff",
    as I don't have that automated (and I need to see the final screen to
    see that it doesn't say "error" too).

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Wed May 21 08:02:39 2025
    "Paul Edwards" <mutazilah@gmail.com> writes:
    "David Brown" <david.brown@hesbynett.no> wrote in message
    [...]
    while C99 is a
    "complete and utter joke" is not going to get you much technical help.

    I don't see what bearing my opinion on C99 (or politics,
    or anything) has on a technical discussion of C90, but
    so be it.
    [...]

    It *should* have no bearing at all. The problem is that if you
    come here and say that C99 is a "complete and utter joke" or make
    similarly inflammatory statements, people are going to react.
    If you don't want that reaction, don't make statements like that.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 08:09:11 2025
    "David Brown" <david.brown@hesbynett.no> wrote in message news:100ia33$2ae8t$1@dont-email.me...

    Sorry, I snipped too hard.

    Telling us that you are doing all this to be "apocalypse-ready" simply

    This is the one that I should have said was a joke.

    access, and dropped the bizarre doomsday philosophy.

    This one is more complicated.

    There may be a reason - even if I can't specifically point to it -
    to use low powered, low-memory devices.

    There are others who seem to genuinely believe that that's
    what our future holds, like this guy:

    https://collapseos.org/

    with links to others saying that what we're currently doing
    can't last, like this:

    https://dothemath.ucsd.edu/2011/10/the-energy-trap/

    I haven't read very much of it, and I'm not saying it is true.
    I just have an interest in "minimal computing" for such a
    scenario (or other scenarios - like North Korea attempting
    to build their own computers as part of their "juche"
    philosophy).

    I'm not willing to change my coding style though, so at
    the moment I basically quote that I need 2 MiB of
    memory, so my own OS can only kick in after others
    have brought technology up to the IBM PC AT level.

    So the Norks will need to get to that point first.

    I bought a Zhaoxin processor so that I could see what
    the Chicoms are capable of. I'm using it right now and
    it's perfectly capable (not good value for money though).

    I'd love to try out an African-made processor too. I'm
    not aware of any. If the whole world was to disappear
    except for Africa, and they were forced to make their
    own processors - no matter what the cost - what
    could they come up with? I'm not expecting that to
    happen. The theoretical situation just interests me. In
    fact - making sure Africans are trained to make
    processors and maintain PDOS is something that
    interests me. Just for the sake of it.

    Some people pointlessly climb Mt Everest too.
    Different people have different hobbies. So be it.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 08:38:44 2025
    "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?

    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).
    So the C90 people did a better job than the Pascal people.

    Although that's partly my question - what belongs in a
    language standard? Maybe the Pascal people got it right,
    and C90 shouldn't have included a library at all - that should
    have been a completely different document.

    But manipulating directories is still very important.

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

    There were presumably some mainframe people hanging
    around who said "you can't add directory manipulation -
    directories don't exist on normal MVS".

    Which isn't completely true.

    And there would have been a time constraint too - we'll
    add directory manipulation separately.

    But I'm not interested in time constraints or personality
    constraints.

    I'm interested in logical constraints.

    There is an existing secondary standard that does provide support
    for directories, among a lot of other things. POSIX. If I wanted
    a system that was based on C90 and could handle directories,
    I can't think of a good reason not to use C90+POSIX. (You might
    have ideological reasons to insist on an earlier edition of POSIX.)

    (MS Windows does not directly support POSIX, or at least does not
    do so usefully, but my impression is that you don't care about that.)

    That is incorrect. I do care about Windows. And MSDOS too.

    Both support directories.

    So any standard for directory manipulation would need to
    cover them. And cover mainframes too.

    You could argue I could take just the subset of POSIX that
    refers to directory manipulation. And then subset that further
    to only include the filename. But then I'm missing the directory
    flag.

    I could subset their flags.

    Or I could do what the folder.c routines do an add a "/"
    indicator at the end.

    The latter seems neater to me.

    But it could potentially be even neater if it was hidden
    away behind a standard fopen etc call.

    That's my question.

    If you want to define your own language based on C90, you're free
    to do so. You've talked about "extending" C90. Some people here
    have interpreted that to mean you want to change what C90 is, so
    there's something called "C90" that includes some stuff you've added.
    Calling your language "C90" will cause confusion and some anger.
    But you can do exactly the same thing by defining a *new* language
    *with a different name* that's based on C90 with whatever additions
    you want. The name can even start with "C", just as "C++" does.

    Sure. I've previously mentioned C90+ or C90+-

    I don't really care what the name is. It would only be a
    working name at this point in time.

    Many of us think that would be a waste of time, but it's not our
    time that's being wasted.

    Sure - I don't expect everyone (or anyone) to agree that
    it is useful.

    And if you want your new language to support directory operations,
    my advice would be to incorporate POSIX directory operations into
    your new language's standard library.

    Why not hide it in fopen()? That's my original question.

    Why should it be opendir() instead of fopen()?

    That's my unanswered question.

    Plus you just said above that it would be reasonable for
    the POSIX directory operations to be directly incorporated
    into C90+'s "standard library".

    The C90 people didn't choose to do that.

    That doesn't necessarily constrain the C90+ people.

    But it does beg the question - would it have been
    ACCEPTABLE for the ANSI 89 people to have
    put that directory manipulation stuff into the C89
    standard IF they could do so quickly?

    Or would that be an ABOMINATION?

    What is the PHILOSOPHY about what SHOULD
    be included in a standard?

    I don't see what bearing my opinion on C99 (or politics,
    or anything) has on a technical discussion of C90, but
    so be it.

    It *should* have no bearing at all. The problem is that if you
    come here and say that C99 is a "complete and utter joke" or make
    similarly inflammatory statements, people are going to react.
    If you don't want that reaction, don't make statements like that.

    I didn't say I didn't want the reaction. I don't care if there is
    or isn't a reaction.

    What I care about is whether the technical question has been
    addressed or not.

    It hasn't been addressed. Nor has fpeek() in a previous thread.
    Nor ESC_STR.

    YMMV.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Wed May 21 08: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 09:09:19 2025
    "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.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Wed May 21 09:18:33 2025
    "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.

    [...]

    But it could potentially be even neater if it was hidden
    away behind a standard fopen etc call.

    That's my question.

    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 don't think it would be a particularly good idea.

    [...]

    Why not hide it in fopen()? That's my original question.

    Why should it be opendir() instead of fopen()?

    That's my unanswered question.

    You won't get a definitive answer. In your own language, you can
    do it that way or not. My opinion on whether it's a good idea is
    irrelevant, since I won't be using your language. I might have
    some interest in it being logically consistent, but directories do
    not seem to present any such issues. You can use fopen(), you can use opendir(), you can invent your own functions, you can leave it out of
    the language and depend on outside standards and/or libraries.

    Plus you just said above that it would be reasonable for
    the POSIX directory operations to be directly incorporated
    into C90+'s "standard library".

    The C90 people didn't choose to do that.

    That doesn't necessarily constrain the C90+ people.

    Right.

    But it does beg the question - would it have been
    ACCEPTABLE for the ANSI 89 people to have
    put that directory manipulation stuff into the C89
    standard IF they could do so quickly?

    Yes.

    Or would that be an ABOMINATION?

    No. (WTF??)

    What is the PHILOSOPHY about what SHOULD
    be included in a standard?

    Different standards have different goals. I cannot advise you what your
    own standard should be based on, since I don't agree with or care about
    your goals.

    I don't see what bearing my opinion on C99 (or politics,
    or anything) has on a technical discussion of C90, but
    so be it.

    It *should* have no bearing at all. The problem is that if you
    come here and say that C99 is a "complete and utter joke" or make
    similarly inflammatory statements, people are going to react.
    If you don't want that reaction, don't make statements like that.

    I didn't say I didn't want the reaction. I don't care if there is
    or isn't a reaction.

    If you post inflammatory statements here, people will react. I'm asking
    you, for the sake of avoiding noise in this newsgroup, not to post such statements here.

    What I care about is whether the technical question has been
    addressed or not.

    It hasn't been addressed. Nor has fpeek() in a previous thread.
    Nor ESC_STR.

    I don't remember what fpeek() is supposed to be; did you have a
    question about it? I think I've discussed ESC_STR with you before.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Wed May 21 09:22:18 2025
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]
    And I am not personally familiar with the philosophy of
    language standards.

    Because there's no such thing, nor does there need to be. Different
    languages are designed by different people with different goals and motivations. I doubt that anyone here can tell you anything useful
    about how your personal language should be defined. You can do whatever
    you like.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 09:57:18 2025
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87tt5ezx9y.fsf@nosuchdomain.example.com...
    "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.

    My question is not "could", it is "should", or "ideally".

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

    None that I can think of.

    Ok, that's a great start. That answers one of my questions.

    But it could potentially be even neater if it was hidden
    away behind a standard fopen etc call.

    That's my question.

    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 don't think it would be a particularly good idea.

    Can you tell me why?

    Why not hide it in fopen()? That's my original question.

    Why should it be opendir() instead of fopen()?

    That's my unanswered question.

    You won't get a definitive answer. In your own language, you can
    do it that way or not. My opinion on whether it's a good idea is
    irrelevant, since I won't be using your language.

    YOUR personal opinion is NOT irrelevant to ME.

    Regardless of whether you use or don't use "my language".
    Or whether it even exists.

    It is mostly a comment on C90.

    ie did the C90 people do anything wrong, in your opinion?

    I might have
    some interest in it being logically consistent, but directories do
    not seem to present any such issues. You can use fopen(), you can use opendir(), you can invent your own functions, you can leave it out of
    the language and depend on outside standards and/or libraries.

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

    Because there's no such thing,

    Thanks for that opinion.

    nor does there need to be.

    And thanks for that one too.

    But perhaps you can elaborate, as I find that statement odd.

    You may as well throw in the entire POSIX, the entire C23,
    and the entire C++ into C90 too. There needs to be some
    philosophy to set constraints.

    One of the constraints was that they were merely trying to
    document existing practice, not create a new language.

    Although they added wonderful things like memmove().

    And there were time constraints too.

    And lack of hindsight constraints too.

    Different
    languages are designed by different people with different goals and motivations. I doubt that anyone here can tell you anything useful
    about how your personal language should be defined. You can do whatever
    you like.

    It's not about me. Obviously I can do whatever I want.

    C90 wasn't designed by one person. K&R C was more-or-less
    designed by one person. But I don't want a language designed
    by one person.

    I want a language that is accepted by a committee.

    Not the C99 committee. Not the C23 committee.

    The C90+ committee. I would probably decide who gets
    to sit on the committee though.

    I probably wouldn't allow you personally to sit on the committtee,
    because you appear to be hostile to the committee's goals.

    But I would appreciate your guidance for the committee.

    Richard would probably be on the committee, as he has
    a shared goal. It's not likely that he wants to though, and
    note that the committee doesn't formally exist yet. And
    nor does it need to formally exist. It is enough to have
    a discussion in comp.lang.c and when you, Keith, give
    the go-ahead for directory manipulations to have been
    incorporated into C90 - because you can't see anything
    wrong with it - then the theoretical committee can
    continue their work on directory manipulations in C90+.

    Plus you just said above that it would be reasonable for
    the POSIX directory operations to be directly incorporated
    into C90+'s "standard library".

    The C90 people didn't choose to do that.

    That doesn't necessarily constrain the C90+ people.

    Right.

    But it does beg the question - would it have been
    ACCEPTABLE for the ANSI 89 people to have
    put that directory manipulation stuff into the C89
    standard IF they could do so quickly?

    Yes.

    Or would that be an ABOMINATION?

    No. (WTF??)

    I don't understand your question.

    There are some things people consider to be abominations.

    If the "far" keyword had been added to the C90 standard,
    would that have been an abomination? Surely some will
    say "yes". I have worked with people who think the whole
    of C90 is an abomination and that only K&R C is acceptable.

    What is the PHILOSOPHY about what SHOULD
    be included in a standard?

    Different standards have different goals. I cannot advise you what your
    own standard should be based on, since I don't agree with or care about
    your goals.

    I have a series of questions that begin with:

    If xyz had been added to the C90 standard, would you have
    considered that to be odd/wrong? If so, why?

    Note that Ritchie himself objected to various things being
    put into the C90 standard.

    Why not you?

    Ritchie is dead. You're not.

    I don't see what bearing my opinion on C99 (or politics,
    or anything) has on a technical discussion of C90, but
    so be it.

    It *should* have no bearing at all. The problem is that if you
    come here and say that C99 is a "complete and utter joke" or make
    similarly inflammatory statements, people are going to react.
    If you don't want that reaction, don't make statements like that.

    I didn't say I didn't want the reaction. I don't care if there is
    or isn't a reaction.

    If you post inflammatory statements here, people will react. I'm asking
    you, for the sake of avoiding noise in this newsgroup, not to post such statements here.

    Some of it is background information.

    ie "don't ask me to 'just use C99'". Or don't ask me "why not
    use C99?". Or "why are you still talking about C90?".

    What I care about is whether the technical question has been
    addressed or not.

    It hasn't been addressed. Nor has fpeek() in a previous thread.
    Nor ESC_STR.

    I don't remember what fpeek() is supposed to be;

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

    did you have a question about it?

    If fpeek had been added to the C90 standard, would you have
    considered that to be odd/wrong? If so, why? If not, what form
    should it have taken?

    I think I've discussed ESC_STR with you before.

    But not to the point where these questions were answered:

    If ESC_STR had been added to the C89 standard, because
    a majority of the committee had decided they wanted to
    support basic ANSI X3.64, would you have considered that
    to be odd/wrong? If so, why? If not, do you think the define
    ESC_STR and ESC_CHAR are a bad naming convention,
    and if so, what do you think would have been better, and why?
    And what header file would you have put them in?

    If instead, C90 had already been published, and suddenly
    committeee members realized they had forgotten about
    ANSI X3.64 terminals and quickly formed a C91 standard
    to add just this one feature, what header file would you
    have put it in, and why?

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Wed May 21 10: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Wed May 21 10: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Wed May 21 10: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 10:23:27 2025
    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:100j5lr$2fqhj$3@dont-email.me...

    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.

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

    My goal is to support C90 - or close - not "real world".

    C90 currently doesn't support directories AT ALL. Neither
    efficient nor inefficient.

    I'm talking about changing that.

    Your "real world" applications won't work on traditional MVS,
    so the features you are trying to make work simply won't work.
    Neither efficient nor inefficient. They won't work. The "real
    world" directories you imagine are not universal.

    However, a somewhat kludged directory system is probably
    universal.

    You probably can write a portable app that does directory
    traversal.

    Portable - including to a mainframe.

    You won't be able to do a mkdir() though.

    Making a directory is a lot of work.

    You need to decide what filetypes you want to support.
    Your files will all need to have extensions (same as CMS
    requires). And you will need to decide how much space
    you want for each file type. And you will also need to
    decide what RECFM you want, and thus what the longest
    line in a text file will be.

    You could potentially go for RECFM=U to avoid that
    issue, but that will be up to the installation.

    And then you will have done what other people can do
    with a mkdir() call.

    ie the C90+ standard will mention "mkdir" may not
    work (implementation-defined). And a portable app
    should not call mkdir().

    But the other operations - except possibly rmdir(), can
    be made to work, I believe. So that is the level where
    you can write portable programs.

    So you can write a zip program, but not an unzip program,
    unless you restrict unzip with "-j".

    Or, there is a way around that. You can do a mkdir()
    outside of your app, and then allow your app to proceed,
    even if mkdir() returns with "directory already exists".

    Access time, inode, file size? Forget about it. Not
    portable.

    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.

    There is no such universal concept for either of those things,
    so outside the remit of both C90 and C90+.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 10:25:07 2025
    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:100j5q0$2fqhj$4@dont-email.me...
    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.

    I don't consider C without POSIX to be sad.

    I consider it to be beautiful.

    My programs work anywhere.

    We have very different goals.

    That doesn't prohibit answering the technical questions,
    should you choose to do so.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 10:31:15 2025
    "Kaz Kylheku" <643-408-1753@kylheku.com> wrote in message news:20250520163755.523@kylheku.com...
    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.

    There was a reason they weren't implemented.

    Probably the same reason they weren't in K&R C either.

    Ritchie had the floor to himself. HE chose not to implement it.
    Because directories don't really exist everywhere.

    But - they sort of do. The concept is - or can be - there.

    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.

    You have stated the problem. I want to run on some
    definition of "absolutely everywhere" that is different
    from "many systems".

    That's why I'm still on C90, for that "absolutely everywhere",
    and now proposing a slight change so that "absolutely
    everywhere" is still technically possible. Even on standard MVS.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Wed May 21 11: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Wed May 21 11: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Wed May 21 11: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?

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Wed May 21 11: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 ...

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Wed May 21 12: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Wed May 21 12: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Wed May 21 12: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.




    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Wed May 21 12: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Wed May 21 13: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Wed May 21 13: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 14: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 14: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Wed May 21 15:41:55 2025
    "Paul Edwards" <mutazilah@gmail.com> writes:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87tt5ezx9y.fsf@nosuchdomain.example.com...
    "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.

    My question is not "could", it is "should", or "ideally".

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

    None that I can think of.

    Ok, that's a great start. That answers one of my questions.

    But it could potentially be even neater if it was hidden
    away behind a standard fopen etc call.

    That's my question.

    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 don't think it would be a particularly good idea.

    Can you tell me why?

    It artificially merges two very distinct concepts for no good
    reason that I can see. Operations that make sense for files make
    far less sense for directories. There's no shortage of interfaces
    for dealing with directories (POSIX, C++, Perl, etc.), and I'm not
    aware of any of them that conflate directories and files. It's true
    that "(almost) everything is a file" is part of the Unix philosophy,
    and directories are typically stored as file-like objects with most
    of the same attributes that files can have, but I can't think of
    any good reason for higher level code to care about that.

    Directory access is largely a solved problem. If you insist on
    creating yet another solution, I recommend following the existing
    solutions.

    ....]

    You may as well throw in the entire POSIX, the entire C23,
    and the entire C++ into C90 too. There needs to be some
    philosophy to set constraints.

    So invent a philosophy that meets your requirements.

    ....]

    C90 wasn't designed by one person. K&R C was more-or-less
    designed by one person. But I don't want a language designed
    by one person.

    I want a language that is accepted by a committee.

    Not the C99 committee. Not the C23 committee.

    The C90+ committee. I would probably decide who gets
    to sit on the committee though.

    I would frankly be surprised if anyone other than you were willing
    to be on that committee. Remember that being a member of a language
    standard committee is a lot of work, and is typically unpaid.

    Richard would probably be on the committee, as he has
    a shared goal. It's not likely that he wants to though, and
    note that the committee doesn't formally exist yet. And
    nor does it need to formally exist. It is enough to have
    a discussion in comp.lang.c and when you, Keith, give
    the go-ahead for directory manipulations to have been
    incorporated into C90 - because you can't see anything
    wrong with it - then the theoretical committee can
    continue their work on directory manipulations in C90+.

    Do not mistake my idle comment for an endorsement.

    Plus you just said above that it would be reasonable for
    the POSIX directory operations to be directly incorporated
    into C90+'s "standard library".

    The C90 people didn't choose to do that.

    That doesn't necessarily constrain the C90+ people.

    Right.

    But it does beg the question - would it have been
    ACCEPTABLE for the ANSI 89 people to have
    put that directory manipulation stuff into the C89
    standard IF they could do so quickly?

    Yes.

    Or would that be an ABOMINATION?

    No. (WTF??)

    I don't understand your question.

    If you don't know what "WTF" means, I suggest a web search. I was
    expression surprise that anyone would use a loaded word like
    "abomination" for something so innocuous.

    [...]

    I have a series of questions that begin with:

    If xyz had been added to the C90 standard, would you have
    considered that to be odd/wrong? If so, why?

    I'm unlikely to be interested in answering most of those questions.
    I don't see how they're in any way relevent, even to what you're
    working on. I have no objection to a new language based on C90,
    but agonizing about what the C90 committee should or should not
    have done is IMHO a waste of time.

    [...]

    It hasn't been addressed. Nor has fpeek() in a previous thread.
    Nor ESC_STR.

    I don't remember what fpeek() is supposed to be;

    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?

    [...]

    If fpeek had been added to the C90 standard, would you have
    considered that to be odd/wrong? If so, why? If not, what form
    should it have taken?

    I have no opinion on that.

    I think I've discussed ESC_STR with you before.

    But not to the point where these questions were answered:

    If ESC_STR had been added to the C89 standard, because
    a majority of the committee had decided they wanted to
    support basic ANSI X3.64, would you have considered that
    to be odd/wrong? If so, why? If not, do you think the define
    ESC_STR and ESC_CHAR are a bad naming convention,
    and if so, what do you think would have been better, and why?
    And what header file would you have put them in?

    If instead, C90 had already been published, and suddenly
    committeee members realized they had forgotten about
    ANSI X3.64 terminals and quickly formed a C91 standard
    to add just this one feature, what header file would you
    have put it in, and why?

    C90 *could* have added a way to refer to the escape character
    (which exists, with different values, in both ASCII and EBCDIC).
    The sensible way to do that would have been to allow a \e escape in
    character constants and string literals. Some languages have exactly
    that feature, and several C compilers support it as an extension.
    No other special character values are defined as named constants
    in headers.

    Perhaps I would have favored standardizing \e at the time, but that
    ship sailed decades ago. I'd probably favor a proposal to add \e
    to C2y.

    In practice, if I need an escape character, I use '\x1b'. I've never
    needed to use an EBCDIC escape character. If I did, I'd use '\x27'.
    If I needed to support both ASCII and EBCDIC escape characters,
    I'd find a way to do that. None of this requires language or standard
    library support.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Wed May 21 15:49:01 2025
    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. 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.

    [...]

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Wed May 21 18: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Wed May 21 18: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 :-)



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 18: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Wed May 21 18: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 19:23:45 2025
    "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.

    I'm not expecting you to agree with his observations.
    I merely said that I did, and was attempting to solve
    the problem we have both seen from the inside.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 19:38:04 2025
    "Kaz Kylheku" <643-408-1753@kylheku.com> wrote in message news:20250520171848.66@kylheku.com...

    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.

    That is a good way of putting it, I think.

    I am after a "constrained" file system, that is actually portable.

    I don't expect my files to have creation dates, access times,
    permissions, as no way exists in C90 to retrieve those things,
    and there is no requirement that they exist. The only thing
    you have is fopen and fseek to the end to find the size, and
    even that has limits that may require to you read the entire
    file.

    In the "real world", people ignore the "C90 model" and just
    tie their application down to a particular platform.

    I am instead wanting to restrict myself to what C90 actually
    says exists.

    Or at least come close to that. E.g. I might do an fseek to
    SEEK_END and not bother to check for an error condition
    and switch to fread. And I'll just say "I only support seekable
    files".

    C90 says what exists for valid technical reasons.

    So keeping the SPIRIT of those "valid technical reasons",
    I would like to say "well, the C90 committee could have
    added xyz and remained within the spirit". The spirit which
    includes things like supporting 36-bit machines. ie the way
    int32_t doesn't.

    So if possible - and it seems that it is possible - I want to
    expand what C90 *could* have done *without*
    compromising portability.

    And I will have an entire OS and supporting tools all written
    within those confines.

    It probably won't be commercially successful.

    But it will be portable.

    It already exists in fact - but I can't write any apps that
    traverse directories. None of the apps I mentioned above
    actually traverse directories. I don't (can't actually),
    do "gcc *.c". I instead have a makefile that lists every C
    file.

    If C90 is extended (my definition) to be able to handle *.c,
    then I could make "gcc *.c" work (even on MVS -
    especially TSO). Currently I am stuck.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 19:45:26 2025
    "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.

    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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 19:50:33 2025
    "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".

    The C library I plonk on it can be updated though.

    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.

    Sounds perfectly capable of responding to the directory
    routines I postulated. ie VMS support could be added
    to folder.c.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 20:00:20 2025
    "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:

    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.

    I don't agree with that.

    Regardless, I'm not attempting to have a debate about the
    definition of "real world".

    That is an example of a system I wish to support. It existed
    at the time the C90 standard came out.

    (Also, I think it's called "z/OS" now.)

    Right. Still exists in 2025 too.

    And that's assuming you want to ignore my MVS/380 update.

    I'm not saying *you* should support MVS. I'm not saying
    the ISO C23 committee should support MVS.

    I note that C90 *does* support MVS.

    And I am saying that my proposed C90+ explicitly needs to
    support MVS 3.8J as an important target that cannot be
    ignored.

    And you can add DEC/VMS too.

    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.

    An official standard that isn't even supported by Windows, which
    is far more important than any POSIX system in existence. Except
    z/OS obviously. But I'm not interested in the bolt-on z/OS Unix.

    Yes - I acknowledge that a POSIX bandwagon exists.

    And if people want to jump on it - that's fine - it's a free world.

    I'm just saying that I rarely use a POSIX-compliant system,
    but do use multiple C90-compliant systems.

    And it is the latter that I wish to make small changes to.
    Supporting what someone else called a "half-baked"
    file system is just one of those several extensions I am
    interested in.

    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".

    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 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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 20:08:03 2025
    "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.

    What is an "over-reaction" or "incorrect reaction" is,
    after pressing him for evidence of such a claim, and
    he can't produce even one single message with such
    a claim - not one - just arm-waves "decades of
    messages" - again - out of decades of messages -
    can't quote one - not one - responding with "oh,
    I'll just take your word for it", instead of calling
    him a probable liar yourself, given that he didn't
    present one single message as evidence.

    This group takes such things to heart.

    I doubt this group speaks with one voice, but I can't
    be bothered checking that.

    If you seek a helpful
    reaction from this group, you'd do better to keep the tone
    non-inflammatory

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

    and rebut such claims quietly and dispassionately

    Ask Scott to MAKE such claims quietly and
    dispassionately, such as:

    "Could you please confirm whether MSDOS is the only
    system you are interested in?" or somesuch.

    rather than jump on your destrier and grab your
    lance.

    He wasn't wielding a lance when lying about me,
    completely unprovoked? Check your blinkers.

    You've already been badged a 'troll'.

    Do you even know what a "troll" is?

    Try not to let the cap fit.

    If anyone was being a troll, it was Scott. So far he has
    generated several messages from the troll.

    I don't think he was being a troll personally. I think he
    was merely being a jackass. YMMV.

    Try not to let the cap fit.

    Try not to join him.

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

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 20: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 20:41:07 2025
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87ldqqzfj0.fsf@nosuchdomain.example.com...

    It artificially merges two very distinct concepts for no good
    reason that I can see. Operations that make sense for files make
    far less sense for directories. There's no shortage of interfaces
    for dealing with directories (POSIX, C++, Perl, etc.), and I'm not
    aware of any of them that conflate directories and files. It's true
    that "(almost) everything is a file" is part of the Unix philosophy,
    and directories are typically stored as file-like objects with most
    of the same attributes that files can have, but I can't think of
    any good reason for higher level code to care about that.

    Thanks. That's a great answer.

    Directory access is largely a solved problem. If you insist on
    creating yet another solution, I recommend following the existing
    solutions.

    Well - that would be:

    struct dirent
    {
    char *d_name; /* of some sort */
    int d_type; /* DT_DIR = directory or anything else = file */
    }

    And opendir(), readdir(), closedir().

    Plus mkdir() - subject to failure - and drop the second parameter
    as there is no such universal thing as permissions. If it does work,
    it is required to create an entire directory structure.

    And rmdir() - also flexible - allow failure


    Are you sure - given the constraints - that a different interface
    isn't appropriate?

    You may as well throw in the entire POSIX, the entire C23,
    and the entire C++ into C90 too. There needs to be some
    philosophy to set constraints.

    So invent a philosophy that meets your requirements.

    Sure. I'm having trouble articulating that.

    C90 wasn't designed by one person. K&R C was more-or-less
    designed by one person. But I don't want a language designed
    by one person.

    I want a language that is accepted by a committee.

    Not the C99 committee. Not the C23 committee.

    The C90+ committee. I would probably decide who gets
    to sit on the committee though.

    I would frankly be surprised if anyone other than you were willing
    to be on that committee. Remember that being a member of a language
    standard committee is a lot of work, and is typically unpaid.

    I've worked on PDOS unpaid for 3 decades.

    The authors of pdld, sasm have been working unpaid for years too.

    Scientists often experiment on themselves - I think there is
    a problem of morality doing it any other way.

    The nature of the beast means that this work is unpaid too.

    Plenty of people make donations or "sponsor a child". That
    is effectively doing unpaid work too.

    Richard would probably be on the committee, as he has
    a shared goal. It's not likely that he wants to though, and
    note that the committee doesn't formally exist yet. And
    nor does it need to formally exist. It is enough to have
    a discussion in comp.lang.c and when you, Keith, give
    the go-ahead for directory manipulations to have been
    incorporated into C90 - because you can't see anything
    wrong with it - then the theoretical committee can
    continue their work on directory manipulations in C90+.

    Do not mistake my idle comment for an endorsement.

    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.

    Plus you just said above that it would be reasonable for
    the POSIX directory operations to be directly incorporated
    into C90+'s "standard library".

    The C90 people didn't choose to do that.

    That doesn't necessarily constrain the C90+ people.

    Right.

    But it does beg the question - would it have been
    ACCEPTABLE for the ANSI 89 people to have
    put that directory manipulation stuff into the C89
    standard IF they could do so quickly?

    Yes.

    Or would that be an ABOMINATION?

    No. (WTF??)

    I don't understand your question.

    If you don't know what "WTF" means, I suggest a web search.

    I knew that already.

    I was
    expression surprise that anyone would use a loaded word like
    "abomination" for something so innocuous.

    I don't consider it to be "innocuous".

    Until fairly recently, I thought it was impossible to do on the
    mainframe and would have excluded that class of machine.

    I have a series of questions that begin with:

    If xyz had been added to the C90 standard, would you have
    considered that to be odd/wrong? If so, why?

    I'm unlikely to be interested in answering most of those questions.
    I don't see how they're in any way relevent, even to what you're
    working on. I have no objection to a new language based on C90,
    but agonizing about what the C90 committee should or should not
    have done is IMHO a waste of time.

    It's for guidance purposes.

    If the C90 committee balked - I want to balk too.

    It hasn't been addressed. Nor has fpeek() in a previous thread.
    Nor ESC_STR.

    I don't remember what fpeek() is supposed to be;

    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?

    That's my question to you. But no - I would expect it
    to return a count of the characters definitely available
    for reading on the stream.

    If so, how does it differ from feof() and/or
    ferror()?

    Surely both of those are very different concepts?

    So - it differs dramatically.

    If I inspect a file, and it hasn't yet hit eof, and it so far
    doesn't have an error - that in no way means that I can
    read at least 1 more byte from the stream.

    And if there isn't 1 more byte from the stream, I will
    block.

    I don't want to block.

    What would it do on an interactive stream?

    Warn me whether I will block.

    What is the use case?

    zmodem file transfer. Open COM1. See if there is a
    pending ZNAK in the middle of the transfer. Without
    blocking.

    Can also check to see if the user has pressed a keystroke
    during the file transfer. Without blocking.

    And without a whole massive multi-threading overhead
    which wouldn't exist on a "simple" (it's not simple when
    you have to write it yourself) system like MSDOS.

    If fpeek had been added to the C90 standard, would you have
    considered that to be odd/wrong? If so, why? If not, what form
    should it have taken?

    I have no opinion on that.

    Ok, I'm here for opinions in case anyone else wants to chime in.

    I think I've discussed ESC_STR with you before.

    But not to the point where these questions were answered:

    If ESC_STR had been added to the C89 standard, because
    a majority of the committee had decided they wanted to
    support basic ANSI X3.64, would you have considered that
    to be odd/wrong? If so, why? If not, do you think the define
    ESC_STR and ESC_CHAR are a bad naming convention,
    and if so, what do you think would have been better, and why?
    And what header file would you have put them in?

    If instead, C90 had already been published, and suddenly
    committeee members realized they had forgotten about
    ANSI X3.64 terminals and quickly formed a C91 standard
    to add just this one feature, what header file would you
    have put it in, and why?

    C90 *could* have added a way to refer to the escape character
    (which exists, with different values, in both ASCII and EBCDIC).
    The sensible way to do that would have been to allow a \e escape in
    character constants and string literals. Some languages have exactly
    that feature, and several C compilers support it as an extension.

    Ok, but for a C90+ or C91 or whatever standard - it would
    require a change to the compiler itself to do the above.

    That would be reasonable for a new language, but not for
    the C90 committee.

    Or my committee where I can't get any compiler vendor
    at all (except for the compilers I control) to add such a thing.

    Updating a header file is a trivial change in comparison.

    So I think a header file is the proper way to go.

    Do you not agree with this?

    Or if you can at least understand why I would prefer a
    header file - would you update an existing one or create
    a new one (perhaps "c90ext.h" - C90 extensions), and
    throw this define in - and what name would you give
    this define?

    No other special character values are defined as named constants
    in headers.

    Perhaps they should be.

    Perhaps I would have favored standardizing \e at the time, but that
    ship sailed decades ago. I'd probably favor a proposal to add \e
    to C2y.

    This "ship sailed" is some sort of semantic issue.

    As you noted - C2y can be updated.

    And also I can create a C90+ standard outside of
    anything ISO does.

    The ship hasn't sailed, from my point of view.

    I have stayed in port for the last nearly 40 years.

    In practice, if I need an escape character, I use '\x1b'. I've never
    needed to use an EBCDIC escape character. If I did, I'd use '\x27'.
    If I needed to support both ASCII and EBCDIC escape characters,
    I'd find a way to do that.

    Thats's my question - "find a way". Specifically - what way?

    None of this requires language or standard
    library support.

    It is unclear to me why you are saying that. First of all, you
    haven't specified what "find a way" is.

    So I don't know what the alternative is to updating the
    language standard.

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

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 20:44:12 2025
    "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".

    Any issue with that?

    Not sure if there is any careful wording needed because people
    have VMS in their minds (obviously they don't literally write
    VMS in the standard - but it may appear in the Rationale).

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

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed May 21 20:46:00 2025
    "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.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 21 21: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Wed May 21 23:59:44 2025
    Reply-To: slp53@pacbell.net

    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?

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Thu May 22 00: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Thu May 22 01: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Thu May 22 01: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.




    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Thu May 22 01: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Thu May 22 02:03:49 2025
    Reply-To: slp53@pacbell.net

    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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Michael S@3:633/280.2 to All on Thu May 22 03: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Thu May 22 04:06:36 2025
    "Paul Edwards" <mutazilah@gmail.com> writes:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87ldqqzfj0.fsf@nosuchdomain.example.com...
    [...]
    Directory access is largely a solved problem. If you insist on
    creating yet another solution, I recommend following the existing
    solutions.

    Well - that would be:

    struct dirent
    {
    [...]
    }
    [...]
    And rmdir() - also flexible - allow failure

    Are you sure - given the constraints - that a different interface
    isn't appropriate?

    I have not said or implied that the POSIX directory interface is the
    only appropriate one. It does have the considerable advantage that it
    already exists.

    My advice is to study and understand existing solutions before inventing
    your own. I can't offer meaningful advice on what's appropriate for
    your language.

    [...]

    Do not mistake my idle comment for an endorsement.

    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.

    No, I don't believe you need to know that. I consider the question of
    what the C90 committee could theoretically have done in some alternate
    timeline irrelevant.

    [...]

    I think I've discussed ESC_STR with you before.

    But not to the point where these questions were answered:

    If ESC_STR had been added to the C89 standard, because
    a majority of the committee had decided they wanted to
    support basic ANSI X3.64, would you have considered that
    to be odd/wrong? If so, why? If not, do you think the define
    ESC_STR and ESC_CHAR are a bad naming convention,
    and if so, what do you think would have been better, and why?
    And what header file would you have put them in?

    If instead, C90 had already been published, and suddenly
    committeee members realized they had forgotten about
    ANSI X3.64 terminals and quickly formed a C91 standard
    to add just this one feature, what header file would you
    have put it in, and why?

    C90 *could* have added a way to refer to the escape character
    (which exists, with different values, in both ASCII and EBCDIC).
    The sensible way to do that would have been to allow a \e escape in
    character constants and string literals. Some languages have exactly
    that feature, and several C compilers support it as an extension.

    Ok, but for a C90+ or C91 or whatever standard - it would
    require a change to the compiler itself to do the above.

    That would be reasonable for a new language, but not for
    the C90 committee.

    There is no C90 committee. That was 35 years ago.

    Or my committee where I can't get any compiler vendor
    at all (except for the compilers I control) to add such a thing.

    You don't have a committee.

    Still, you claim to be creating a new language that happens to be based
    on C90. Are you adding a new constraint that any differences between
    C90 and your language cannot require compiler changes?

    Changing existing library implementations is not significantly easier
    than changing existing compiler implementations. There are open source implementations of both.

    Updating a header file is a trivial change in comparison.

    So I think a header file is the proper way to go.

    Do you not agree with this?

    I do not.

    With this new information that you're unwilling to do anything that
    requires compiler changes, it seems to me that you can achieve your
    goals by taking an existing conforming C90 implementation and adding
    some library code (headers and implementation).

    Or if you can at least understand why I would prefer a
    header file - would you update an existing one or create
    a new one (perhaps "c90ext.h" - C90 extensions), and
    throw this define in - and what name would you give
    this define?

    No other special character values are defined as named constants
    in headers.

    Perhaps they should be.

    Perhaps I would have favored standardizing \e at the time, but that
    ship sailed decades ago. I'd probably favor a proposal to add \e
    to C2y.

    This "ship sailed" is some sort of semantic issue.

    As you noted - C2y can be updated.

    And also I can create a C90+ standard outside of
    anything ISO does.

    The ship hasn't sailed, from my point of view.

    The ship that has sailed is the C90 standard.

    One more time, C90 itself will not change. You're free to define your
    own language/library/whatever based on C90, but it will not be C90.

    I have stayed in port for the last nearly 40 years.

    In practice, if I need an escape character, I use '\x1b'. I've never
    needed to use an EBCDIC escape character. If I did, I'd use '\x27'.
    If I needed to support both ASCII and EBCDIC escape characters,
    I'd find a way to do that.

    Thats's my question - "find a way". Specifically - what way?

    None of this requires language or standard
    library support.

    It is unclear to me why you are saying that. First of all, you
    haven't specified what "find a way" is.

    I have: "support both ASCII and EBCDIC escape characters". It's not
    something I've ever needed to do, so I have not spent time or effort
    deciding how to do it.

    So I don't know what the alternative is to updating the
    language standard.

    You mean creating your own language standard based on the existing C90 standard. C90 itself will change. Please be clear on that point.

    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.)

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Thu May 22 04:15:22 2025
    "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.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Thu May 22 04:22:26 2025
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]
    So I don't know what the alternative is to updating the
    language standard.

    You mean creating your own language standard based on the existing C90 standard. C90 itself will change. Please be clear on that point.

    Sorry, I omitted a very important word.

    You mean creating your own language standard based on the existing C90 standard. C90 itself will *not* change. Please be clear on that point.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Thu May 22 05: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Thu May 22 05: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Thu May 22 06:58:07 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Thu May 22 07:02:14 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Waldek Hebisch@3:633/280.2 to All on Thu May 22 07: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: To protect and to server (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Thu May 22 09: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Thu May 22 10: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Jakob Bohm@3:633/280.2 to All on Thu May 22 10: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Privat (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Thu May 22 12: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Thu May 22 15: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?

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Thu May 22 15:14:19 2025
    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 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.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Thu May 22 16: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Thu May 22 17: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Thu May 22 20: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Fri May 23 03: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Fri May 23 04: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Fri May 23 04:34:55 2025
    It's ridiculous that people use a language where it is a complex
    task to do directory operations. With C++17 I use the parts of
    std::filesystem and theres not much more to desire.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Fri May 23 07:10:32 2025
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87a575zvmb.fsf@nosuchdomain.example.com...

    Hi Keith.

    First - thanks a lot of teasing out an unstated assumption.

    I am often operating on a set of assumptions. But I don't
    list them upfront because I don't actually know what
    they are.

    Are you sure - given the constraints - that a different interface
    isn't appropriate?

    I have not said or implied that the POSIX directory interface is the
    only appropriate one. It does have the considerable advantage that it already exists.

    My advice is to study and understand existing solutions before inventing
    your own. I can't offer meaningful advice on what's appropriate for
    your language.

    I have now been given two pointers. Common Lisp,
    and C++ 17. Do you have any comment based on
    your knowledge of those?

    Do not mistake my idle comment for an endorsement.

    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.

    No, I don't believe you need to know that. I consider the question of
    what the C90 committee could theoretically have done in some alternate timeline irrelevant.

    You're reading too much into my idle use of "C90 committee".

    I'm not talking about what the personalities were or anything
    like that. I'm trying to "set the stage". ie there were existing
    machines - including 36-bit machines - that needed to be
    supported. They can't just be dismissed as "museum junk"
    so that you don't need to go through the intellectual exercise
    of how best to support a 36-bit machine.

    "My C90+ committee" (a theoretical construct), needs to
    support 36-bit machines. They cannot be imagined out of
    existence. Nor can mainframes. Nor can MSDOS, so the
    committee may start agonizing over whether the add the
    "far" and "near" keyword in due course, but that process
    hasn't started yet.

    Or my committee where I can't get any compiler vendor
    at all (except for the compilers I control) to add such a thing.

    You don't have a committee.

    Still, you claim to be creating a new language that happens to be based
    on C90. Are you adding a new constraint that any differences between
    C90 and your language cannot require compiler changes?

    Changing existing library implementations is not significantly easier
    than changing existing compiler implementations. There are open source implementations of both.

    And here you have managed to tease out the unstated assumption.

    I can and do use closed-source compilers like Microsoft C 6.0
    and Visual Studio 2022.

    They produce fantastic code.

    But I bring my own library to the table - PDPCLIB. I basically
    never use Microsoft's library. Or Watcom or anyone else.

    And I am happy to go to any platform (OS, not compiler),
    and bring my own C library (and modify it as required),
    and use whatever C compiler I happen to find on that
    platform.

    This has been done over 30 years, and I have refused to
    put anything non-C90 into my library. Which upset some
    people.

    Only now - with the platforms I have immediate interest
    in (mainframes, MSDOS, Amiga, Linux etc) covered to
    my satisfaction by C90 - which for example included
    changing a couple of paradigms that the IBM mainframe
    library used - which also upset a lot of people - I am
    considering putting non-C90 stuff into PDPCLIB.

    Note that none of this stuff is being done to deliberately
    upset people. I just don't want to be constrained by
    decisions IBM made at the time - oh yeah - another
    unstated assumption - nor do I want to be constrained
    by existing code.

    Existing code, existing libraries, existing standards, are
    all important guides, but not hard constraints.

    I have "no" interest in "fixing" bitwise precedents in
    C90, for example. I reserve the right to change my
    mind about that in 20 years from now or whatever
    though.

    But right at the moment, I am interested in issues that
    came up when I assembled an entire ecosystem (OS
    and toolchain), as well as supporting the existing
    mentioned OSes.

    I can't practically change Visual Studio, but even then,
    I would be open to negotiation, if someone were to
    say "look, all the extant compilers support xyz, and
    if you zap offset 156383 of cl.exe in Visual Studio,
    it will be brought into line with all the other compilers,
    and xyz is the way forward", then I would indeed
    consider compiler changes.

    But I seriously doubt that xyz even exists, much less
    that it could be "fixed" with a 1-byte zap.

    So while I don't want to say "I refuse to change
    existing compilers", in practice, that is the case.

    What I am more likely to say is "I don't want to support
    Microsoft C 5.1, even though it is freely available (as
    part of the MSDOS 4.0 distribution - you need to use
    Microsoft C 6.0, which isn't, or switch out to Watcom
    or something".

    Microsoft C 6.0 can compile PDOS and PDPCLIB as-is,
    5.1 can't.

    I'm not totally ruling out changing PDOS and PDPCLIB though.
    I could potentially change them to support not just Microsoft
    C 5.1 but also SubC, or an improved SubC.

    So yeah - I'm happy to change the extant code that I care
    about (which, unusually, is not a lot - I only care about my toolchain/ecosystem - which is all C90-compliant).

    Even though I only care about that, it so happens that
    other people's C90-compliant code should work fine on
    the ecosystem that I provide. But maybe one day in the
    future I will invalidate all bitwise code that doesn't use
    brackets appropriately. Or the other way around. But
    right at the moment, I haven't diverged one iota from
    C90.

    Also right at the moment, PDOS-generic has a very
    crude and awful directory listing mechanism, and I'm
    looking to fix that, which is why I'm here to decide
    my next move, as there are multiple ways to go.

    In the past, I have just used MSDOS as a guide, as it
    is a simple system, so they've probably solved the
    problem already for all systems, including small systems.
    But the DTA structure they use seems very inappropriate
    to me. And so first I am asking about the theoretical
    underpinnings of directories. I doubt that after hearing
    about the theory, the conclusion will be "so DTA is
    definitely the way to go!". But I don't want to prejudge
    that.

    With this new information that you're unwilling to do anything that
    requires compiler changes, it seems to me that you can achieve your
    goals by taking an existing conforming C90 implementation and adding
    some library code (headers and implementation).

    Yes.

    One more time, C90 itself will not change. You're free to define your
    own language/library/whatever based on C90, but it will not be C90.

    Yes, I acknowledge that long ago.

    I have stayed in port for the last nearly 40 years.

    In practice, if I need an escape character, I use '\x1b'. I've never
    needed to use an EBCDIC escape character. If I did, I'd use '\x27'.
    If I needed to support both ASCII and EBCDIC escape characters,
    I'd find a way to do that.

    Thats's my question - "find a way". Specifically - what way?

    None of this requires language or standard
    library support.

    It is unclear to me why you are saying that. First of all, you
    haven't specified what "find a way" is.

    I have: "support both ASCII and EBCDIC escape characters". It's not something I've ever needed to do, so I have not spent time or effort
    deciding how to do it.

    The C90 committee was forced to consider that. That's why
    'A' to 'Z' are not guaranteed to be consecutive, but '0' to '9' are.

    Without either ASCII or EBCDIC mentioned in the C90 standard.

    Regardless, that's what I'm after - a decision on how to do it.
    If you personally don't want to spend the time and effort and/or
    make a decision, that's fine - I'm hoping someone in the group
    will do that, and perhaps when they propose a solution you will
    chime in and say "no, that's not a good idea for xyz reason".

    That's what I'm here for/looking for - discussion. A similar but
    not identical discussion that the C90 committee would have had.

    A very different environment. No time constraint. Benefit
    of hindsight.

    So I don't know what the alternative is to updating the
    language standard.

    You mean creating your own language standard based on the existing C90 standard. C90 itself will not change. Please be clear on that point.

    Yes - that's a given. As I acknowledged long ago.

    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.

    There is, at least depending on your definition.

    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,

    There is - I produce one myself (via emulation) - do you
    want me to give you a link? Proven against real mainframe
    hardware (despite the claims that my software will never
    run on a real mainframe).

    A TN3270 link doesn't prevent an EBCDIC ESC from
    being sent down the link, so that is used for encapsulation.

    Also, my understanding is that that's not the only environment.
    The z/OS Unix (which I haven't personally used) apparently
    has a termcap or something with EBCDIC ANSI X3.64 in it.
    That gets translated to ASCII by some other bit of infrastructure
    before it goes over the internet though. But the mainframe side
    is EBCDIC - I've been told.

    Regardless - even if there were no existing "real" or emulated
    terminals that did EBCDIC ANSI - it exists as a theoretical
    construct, which is all that matters (to me, anyway).

    and I see no need for a terminal that does so.

    Even if you see no need for one - I have a "need" for one. How
    else is Microemacs 3.6 supposed to work? My fingers are
    trained for microemacs, and I wish to use a mainframe.

    (Terminals
    used with mainframes operate very differently.)

    MOST terminals operate very differently.

    I prefer to bypass MOST terminals and do whatever is
    required to run microemacs on the mainframe.

    Even if it takes 30 years to do.

    Which it did.

    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.

    Yeah - I've rethought my position on this.

    I want to be able to do an unzip.

    On a mainframe, so long as I create the directories I know
    I will need in advance (outside of C90), then I can make
    unzip unzip into those existing directories.

    On a Unix etc system, I don't need to do that preparatory
    work.

    So the best thing is for mkdir() to "work", either automatically
    on Unix, or if appropriate preparation is done on the mainframe.

    I don't really care what happens if you don't do the required
    preparatory work on the mainframe.

    Just like I don't really care what happens on Unix if you run
    out of disk space. Or inodes.

    My interest is a "properly-prepared and bug-free environment".

    That's what I'm trying to make work.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Fri May 23 07:45:43 2025
    "Kaz Kylheku" <643-408-1753@kylheku.com> wrote in message news:20250521121507.235@kylheku.com...

    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.

    I already have exactly that.

    My new OS - PDOS-generic - runs under what I call a
    pseudobios. Basically exactly the same as UEFI, except
    instead of a UEFI "Open" or whatever they use, I have
    instead used fopen().

    Other people have converted UEFI into Posix. I converted
    it into C90 (others may have done that too).

    Regardless - with that pseudobios (or whatever you want
    to call it) in place, I have an OS that runs under that. The
    OS is passed a parameter of the "boot disk", which it
    does a callback to the pseudobios's exported fopen to open.

    The pseudobios can in fact be a fairly simple C90 program -
    an ordinary program running under Windows, Unix etc.

    In which case PDOS-generic will do all its operations on
    that simple flat file - as r+b - as you noted.

    But on some pseudobioses it is instead a privileged program
    because it is the actual UEFI BOOTX64.EFI or whatever.

    And in that instance, although you can give it a flat file to
    open, and it will happily constrain itself to that flat file, you
    can ADDITIONALLY give it a "!BOOT" parameter
    (this is something else that may or may not belong in a
    C90+ standard).

    If you do !BOOT, it will still do the exact same FAT32
    operations, but it will do them over the entire boot disk.
    ie it takes control of the "host" disk.

    That can't be done when running on the pseudobios that
    PdAndro (in the Google Play Store) presents though. For
    two reasons. First, I don't have privilege, because I don't
    rely on jailbreaking, and secondly, the host system is not
    FAT32 as far as I am aware.

    So that's all existing and proven on various systems, including
    Windows. I even have it working to some extent on the mainframe
    - to the point where you can do a "dir" under an MVS batch job.
    But there is still a bug that is preventing file creation, which
    someone else is tracking down currently.

    And now I have added a 3rd option. If you pass PDOS-generic
    a parameter of "-allbios", there is no boot disk to open, and
    it will instead send every fopen() attempt to the pseudobios,
    in the hope that the pseudobios has the ability to open individual
    files (UEFI does, but a pseudobios layered on top of the
    IBM PC BIOS would only likely be able to handle !BOOT).

    And it is this 3rd option I am trying to get to work. I have already
    proven it under Windows, where I was able to create a \DOS
    directory on my Windows 10 machine. Android is a bit more
    complicated, and I have asked a question about that here:

    https://www.bttr-software.de/forum/board_entry.php?id=22595

    I can lift that \DOS restriction in due course, but currently, even
    on Windows, I cannot yet do a "dir". I am sending fopen requests
    up to the pseudobios, but I am not sending "opendir" requests
    up to the pseudobios, because "opendir" doesn't yet exist.

    And that's the crossroad I am now at. I don't know whether
    to add an opendir(), plus a mkdir() that differs from POSIX,
    or use the folder routines from Jean-Marc, or some other
    option. That's my question. And while answering the question,
    give some consideration to the fact that there are other changes
    that I think - in hindsight - should have ideally been formalized
    by a C90+ committee - such as EBCDIC ESC.

    I believe then, as now, there were a lot of people frustrated that
    EBCDIC is even a consideration. Can't the damned thing just
    die already? But I'm the opposite of that. I want to nurture
    EBCDIC. It provides an abstraction too.

    I'm not asking anyone to agree with me. I'm just after technical
    analysis.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Fri May 23 07:52:27 2025
    "Scott Lurndal" <scott@slp53.sl.home> wrote in message news:k%kXP.478614$lK62.236751@fx13.iad...

    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?

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

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Fri May 23 08:06:36 2025
    "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.

    But regardless - if you want to be really pedantic, forget about
    ANSI X3.64 completely. I am creating a new standard called
    non-ANSI X3.64, which allows either ASCII or EBCDIC,
    so any reference to "ASCII" is replaced with "character set"
    or any other term that means "ASCII or EBCDIC or maybe
    even other things".

    I do not believe this is difficult to understand.

    I do not believe I have not made myself clear.

    However, my perspective may be incorrect, and if you still
    don't understand, it would be great if someone could
    translate English to English.

    I have this problem quite a lot. I don't know why - it's as
    clear as day to me. Just like the C90 thing. Obviously I'm
    not talking about inventing a time machine and/or sneaking
    into the ISO office and changing all their existing copies
    of C90 and then all the other copies everywhere in the
    world, and all the derivatives too.

    That is VERY OBVIOUS to me.

    But for whatever reason, my casual use of "update C90"
    is treated as if I am about to invent not just a time machine,
    but coerce the existing members of the C90 committee to
    do what I want.

    Which is obviously ridiculous, so "clearly" not what I meant.

    And the obvious alternative to the above, was obvious all
    along. TO ME.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Fri May 23 08:32:08 2025
    "Paul Edwards" <mutazilah@gmail.com> writes:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87a575zvmb.fsf@nosuchdomain.example.com...
    Hi Keith.

    First - thanks a lot of teasing out an unstated assumption.

    I am often operating on a set of assumptions. But I don't
    list them upfront because I don't actually know what
    they are.

    Are you sure - given the constraints - that a different interface
    isn't appropriate?

    I have not said or implied that the POSIX directory interface is the
    only appropriate one. It does have the considerable advantage that it
    already exists.

    My advice is to study and understand existing solutions before inventing
    your own. I can't offer meaningful advice on what's appropriate for
    your language.

    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.

    The POSIX interface (readdir et al) happens to be the one I'm most
    familiar with. In fact it's pretty much the only one I'm familiar with.
    I have no comment on the others.

    As I've said before, I don't think your idea of doing directory access
    via fopen() is practical.

    [...]

    Changing existing library implementations is not significantly easier
    than changing existing compiler implementations. There are open source
    implementations of both.

    And here you have managed to tease out the unstated assumption.

    I can and do use closed-source compilers like Microsoft C 6.0
    and Visual Studio 2022.

    They produce fantastic code.

    But I bring my own library to the table - PDPCLIB. I basically
    never use Microsoft's library. Or Watcom or anyone else.

    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.
    Apparently PDPCLIB is that library. 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.

    C has *always* been designed to work with libraries in addition to
    the standard library. POSIX is just one example. Win32 is another.
    And there are countless other libraries, large and small. 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); you can
    either use it as it's defined or ignore it. You can create and
    document your own library that does whatever you want. It doesn't
    have to be a "standard". It's just a library. It may or may not
    depend on features of the C90 standard library.

    The implementation of that library might have to be modified for
    different target systems.

    [...]

    I have: "support both ASCII and EBCDIC escape characters". It's not
    something I've ever needed to do, so I have not spent time or effort
    deciding how to do it.

    The C90 committee was forced to consider that. That's why
    'A' to 'Z' are not guaranteed to be consecutive, but '0' to '9' are.

    Without either ASCII or EBCDIC mentioned in the C90 standard.

    I was specifically talking about the ESCAPE character, which the C90
    committee ignored.

    Regardless, that's what I'm after - a decision on how to do it.
    If you personally don't want to spend the time and effort and/or
    make a decision, that's fine - I'm hoping someone in the group
    will do that, and perhaps when they propose a solution you will
    chime in and say "no, that's not a good idea for xyz reason".

    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.

    There's no portable way for the preprocessor to know whether the
    target character set is ASCII, EBCDIC, or something else, but
    can it be determined at compile time with a constant expression.
    Note that this will likely fail if the target character set is not
    based on either ASCII or EBCDIC. That's not likely to be relevant
    in the real world, and apparently you've decided for some reason
    not to care about the possibility.

    [...]

    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.
    [...]

    There is - I produce one myself (via emulation) - do you
    want me to give you a link? Proven against real mainframe
    hardware (despite the claims that my software will never
    run on a real mainframe).

    So there's one emulator that nobody other than you uses?

    Ok, fine, whatever.

    [...]

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Fri May 23 08:44:01 2025
    "Paul Edwards" <mutazilah@gmail.com> wrote in message news:100o3sc$3ll6t$1@dont-email.me...
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87a575zvmb.fsf@nosuchdomain.example.com...

    I can't practically change Visual Studio, but even then,
    I would be open to negotiation, if someone were to
    say "look, all the extant compilers support xyz, and
    if you zap offset 156383 of cl.exe in Visual Studio,
    it will be brought into line with all the other compilers,
    and xyz is the way forward", then I would indeed
    consider compiler changes.

    But I seriously doubt that xyz even exists, much less
    that it could be "fixed" with a 1-byte zap.

    So while I don't want to say "I refuse to change
    existing compilers", in practice, that is the case.

    Actually, that language is too strong.

    If a conclusion is reached that there is very strong
    evidence that "the way forward" is that the compiler
    itself needs to change, and I need to give up
    Microsoft C - so be it.

    I don't have any hard position on anything that I am
    aware of.

    Even the old mainframes - I may give them up as a
    relic. But before I do, I want to make sure they are
    graced with C90.

    It took decades before I created a 64-bit flavor of
    PDPCLIB. And I went to a lot of effort to try to keep
    the IBM PC BIOS alive.

    But one day there was a factor that made me decide
    to support 64-bit. I can't remember exactly, but I think
    it might have been the PDOS-generic concept, and I
    wasn't sure I could support 16-bit with it, and so instead
    I decided to do 64-bit first, as an abstraction, so that I
    could gain some experience, before heading back to
    16-bit.

    Note that when I produced S/380 so that we could "push
    forward the mainframe technology", it was only then that
    I found that this "wasn't a thing that others were trying to do".
    I had seen others writing software for MVS 3.8J - lots of
    time spent on this - but that fitted into their sense of
    "nostalgia" somehow (even if it was new software), rather
    than "how close can we get to z/OS so that we can be a
    viable competitor?".

    I was running under an unstated assumption, and had
    incorrectly assumed that other people were operating
    a similar way, based on the fact that I could see MVS 3.8J
    becoming more and more viable every day.

    I don't have a fixed goal. I could be persuaded to become
    a Tibetan monk.

    Or in more realistic terms - I could be persuaded to just
    stick with gcc 3.2.3 and forget about Microsoft products,
    because "some of these features that will make a real
    difference need to go into the compiler, and you can't
    be dictated to by Microsoft".

    But just like the IBM PC BIOS, and 32-bit, I will cling
    to Microsoft etc C90-compliant compilers to the bitter end.
    Only when I see with my own eyes that I need to abandon
    Microsoft C 6.0 will I abandon Microsoft C 6.0.

    The compiler. Not the library. The library was abandoned
    a long time ago.

    Someone has updated gcc to include an IA-16 target.
    I have never expressed much interest in that. But under
    the right circumstances, I might find myself getting that
    code and back-porting it to gcc 3.2.3.

    As an example. Of a somewhat meandering goal.

    Perhaps you could say my goal is "to fix the issues that
    Jeff outlined in that original link I posted". But I don't
    want to tie myself down to that either. "grace hardware
    with C90 or close" might be a concrete goal too.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Fri May 23 08: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Fri May 23 09: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Fri May 23 09: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Fri May 23 09:16:59 2025
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87bjrkxonr.fsf@nosuchdomain.example.com...

    Hi Keith.

    I can now see a series of disconnects.

    But hopefully now I can articulate the issue.

    "Paul Edwards" <mutazilah@gmail.com> writes:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87a575zvmb.fsf@nosuchdomain.example.com...
    Hi Keith.

    First - thanks a lot of teasing out an unstated assumption.

    I am often operating on a set of assumptions. But I don't
    list them upfront because I don't actually know what
    they are.

    Are you sure - given the constraints - that a different interface
    isn't appropriate?

    I have not said or implied that the POSIX directory interface is the
    only appropriate one. It does have the considerable advantage that it
    already exists.

    My advice is to study and understand existing solutions before
    inventing
    your own. I can't offer meaningful advice on what's appropriate for
    your language.

    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.

    The POSIX interface (readdir et al) happens to be the one I'm most
    familiar with. In fact it's pretty much the only one I'm familiar with.
    I have no comment on the others.

    As I've said before, I don't think your idea of doing directory access
    via fopen() is practical.

    Sure. You explained that operations on directories are
    different from operations on files, and it would nominally
    be wrong to shoehorn directory access into a FILE
    stream.

    I didn't see anyone dispute that.

    Although having said that - if FILE is a misnomer and really
    means STREAM - perhaps directory access is also a stream,
    and some streams require additional operations, e.g. streamMkdir().

    Changing existing library implementations is not significantly easier
    than changing existing compiler implementations. There are open source
    implementations of both.

    And here you have managed to tease out the unstated assumption.

    I can and do use closed-source compilers like Microsoft C 6.0
    and Visual Studio 2022.

    They produce fantastic code.

    But I bring my own library to the table - PDPCLIB. I basically
    never use Microsoft's library. Or Watcom or anyone else.

    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.

    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.

    (I didn't previously state this, because I wasn't aware
    of it, again)

    Apparently PDPCLIB is that library.

    No. PDPCLIB is just one of many, many C90-compliant
    libraries.

    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, 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.

    C has *always* been designed to work with libraries in addition to
    the standard library. POSIX is just one example. Win32 is another.
    And there are countless other libraries, large and small. 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); you can

    Disconnect. I didn't say "need". The word is "want".

    either use it as it's defined or ignore it. You can create and
    document your own library that does whatever you want. It doesn't
    have to be a "standard".

    Disconnect. Not "have" - "want".

    It's just a library. It may or may not
    depend on features of the C90 standard library.

    No. It IS C90+.

    The implementation of that library might have to be modified for
    different target systems.

    Of course. The language library standard simply says what is required.

    I have: "support both ASCII and EBCDIC escape characters". It's not
    something I've ever needed to do, so I have not spent time or effort
    deciding how to do it.

    The C90 committee was forced to consider that. That's why
    'A' to 'Z' are not guaranteed to be consecutive, but '0' to '9' are.

    Without either ASCII or EBCDIC mentioned in the C90 standard.

    I was specifically talking about the ESCAPE character, which the C90 committee ignored.

    Sure. Sorry - loose language. They were forced - begrudingly
    from what I think I remember I read - to consider the mainframe
    implications. And most couldn't understand why the mainframe
    was so complicated, with record formats etc.

    Regardless, that's what I'm after - a decision on how to do it.
    If you personally don't want to spend the time and effort and/or
    make a decision, that's fine - I'm hoping someone in the group
    will do that, and perhaps when they propose a solution you will
    chime in and say "no, that's not a good idea for xyz reason".

    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.

    Disconnect. Not what I prefer. What the theoretical committee decides.

    This is intended to be in the official ISO C standard for the next
    1 million years.

    Actually influencing ISO is a separate exercise.

    It probably won't involve coercion.

    But coercion wouldn't be required if the C90+ committee comes
    up with something reasonable.

    That's the goal. Something reasonable.

    There's no portable way for the preprocessor to know whether the
    target character set is ASCII, EBCDIC, or something else, but
    can it be determined at compile time with a constant expression.

    There is no need for portability. Every theoretical vendor
    will implement it for their particular platform.

    It is the standard itself that is portable. Not the implementation.

    Note that this will likely fail if the target character set is not
    based on either ASCII or EBCDIC. That's not likely to be relevant
    in the real world, and apparently you've decided for some reason
    not to care about the possibility.

    I haven't really decided such a thing.

    You can probably say that I have decided that future versions
    of C will only work on character sets that include an ESC
    character.

    I (tentatively) don't want to be forever tied to the past. There
    are some ancient platforms where you can't really implement
    C at all, from what I saw of the description.

    It's enough for me that the ASCII character set exists, but not
    necessarily at those code points. There are EBCDIC equivalents
    for every ASCII character. There are a couple of extra
    printable EBCDIC characters. And I more-or-less wish to
    ban their use. If such wording can be put into the standard
    in a nice way. Like. "if you use the cent symbol, results are
    undefined". Just warn people off. So sticklers for the standard -
    like me - will not go anywhere near it.

    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.
    [...]

    There is - I produce one myself (via emulation) - do you
    want me to give you a link? Proven against real mainframe
    hardware (despite the claims that my software will never
    run on a real mainframe).

    So there's one emulator that nobody other than you uses?

    Ok, fine, whatever.

    Even if there were 0 emulators, the argument would be
    exactly the same as if 90% of the planet used it.

    And if I am one day elected president of the USA, at the
    same time as Chancellor of Germany, and a few other
    places, you may well find 90% of the planet using it (or
    at least, having it on their system).

    That's a work in progress. And the progress of that is
    completely irrelevant to the technical question - from my
    point of view, anyway. That's exactly what argument
    ad populum is all about.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Fri May 23 09:26:47 2025
    "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.

    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.

    But reality is, plenty of times, if you gives someone a Windows
    executable, they will say "I can't run that, I'm on Linux".
    Technically, with a lot of work, they could probably run it.
    But they don't want to add anything to anything.

    And vice versa.

    No matter how many times someone says to me "just install WSL",
    or Cygwin, I am not going to install either. So there is no point
    giving me a Linux executable. It won't work. Nor will a
    recompilation from source work. I don't have the headers.

    Although if you want to be pedantic, I do have another way of
    running a Linux executable. But it's not on my native Windows
    system. And I have a very old and very odd Cygwin that I
    spent a lot of time getting for my Windows 2000 system. I think
    I needed one that matched the gcc 3.2.3 I use. But it's not on
    my Windows 10 system regardless.

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

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Fri May 23 10: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Fri May 23 10: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Fri May 23 11: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Fri May 23 11: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Fri May 23 11:24:49 2025
    "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.

    But regardless - if you want to be really pedantic, forget about
    ANSI X3.64 completely. I am creating a new standard called
    non-ANSI X3.64, which allows either ASCII or EBCDIC,
    so any reference to "ASCII" is replaced with "character set"
    or any other term that means "ASCII or EBCDIC or maybe
    even other things".

    And you're free to do that, of course. My personal opinion is
    that defining a new standard based on ANSI X3.64 except that it
    supports EBDIC is a waste of time. I'm not aware that anyone other
    than you wants such a thing or would use it if it were available.
    But it's not my job to tell you how to spend your time and effort.

    I do not believe this is difficult to understand.

    I do not believe I have not made myself clear.

    However, my perspective may be incorrect, and if you still
    don't understand, it would be great if someone could
    translate English to English.

    I have this problem quite a lot. I don't know why - it's as
    clear as day to me. Just like the C90 thing. Obviously I'm
    not talking about inventing a time machine and/or sneaking
    into the ISO office and changing all their existing copies
    of C90 and then all the other copies everywhere in the
    world, and all the derivatives too.

    That is VERY OBVIOUS to me.

    But for whatever reason, my casual use of "update C90"
    is treated as if I am about to invent not just a time machine,
    but coerce the existing members of the C90 committee to
    do what I want.

    Which is obviously ridiculous, so "clearly" not what I meant.

    And the obvious alternative to the above, was obvious all
    along. TO ME.

    I'm sure it was obvious to you. The problem is that you prioritize
    a lot of things that most other people consider to be useless.
    Your EBCDIC-based not-quite-ANSI-X3.64 "standard" is an example.

    I'm *not* telling you not to do all this stuff. If you want build
    some large project that nobody else in the world needs or wants,
    feel free. Nobody asked for 139 different C implementations of
    FizzBuzz, but I did that, just for the fun of it.

    But if someone thinks that an EBCDIC-based terminal standard is
    vital to the post-apocalytic future of humanity, it's not a big
    stretch to think that the same person wants to make changes to the
    C90 standard and have the modified document be recognized as "C90".

    But you've now made it clear that that's *not" what you're doing,
    so I'm not sure what you're still complaining about. There was a misunderstanding, and you've cleared it up.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Fri May 23 11:38:52 2025
    "Paul Edwards" <mutazilah@gmail.com> writes:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87bjrkxonr.fsf@nosuchdomain.example.com...
    Hi Keith.

    I can now see a series of disconnects.

    But hopefully now I can articulate the issue.

    "Paul Edwards" <mutazilah@gmail.com> writes:
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message
    news:87a575zvmb.fsf@nosuchdomain.example.com...
    Hi Keith.

    First - thanks a lot of teasing out an unstated assumption.

    I am often operating on a set of assumptions. But I don't
    list them upfront because I don't actually know what
    they are.

    Are you sure - given the constraints - that a different interface
    isn't appropriate?

    I have not said or implied that the POSIX directory interface is the
    only appropriate one. It does have the considerable advantage that it
    already exists.

    My advice is to study and understand existing solutions before
    inventing
    your own. I can't offer meaningful advice on what's appropriate for
    your language.

    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.

    It doesn't matter to me whether a directory management interface is
    part of a language standard or not. I don't know why it matters
    to you. C didn't standardize opendir(), but POSIX did, so I use
    opendir() on systems that support it.

    [...]

    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.

    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.

    (I didn't previously state this, because I wasn't aware
    of it, again)

    I don't believe that you personally will have any influence over any
    future C standard. Your goals are too different from the goals of the committee and those of the vast majority of people who care about C.

    [...]

    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, 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.

    In my opinion that will never happen.

    I have no problem with whatever functionality you want to provide in
    your PDPCLIB, and I'm willing to discuss some of it in technical terms.

    [...]

    It's just a library. It may or may not
    depend on features of the C90 standard library.

    No. It IS C90+.

    I don't know what you mean by that. If you mean that your PDPCLIB
    library IS "C90+", that's fine; both are your invented terms.
    But it's an odd choice of terminology.

    The implementation of that library might have to be modified for
    different target systems.

    Of course. The language library standard simply says what is required.

    I have: "support both ASCII and EBCDIC escape characters". It's not
    something I've ever needed to do, so I have not spent time or effort
    deciding how to do it.

    The C90 committee was forced to consider that. That's why
    'A' to 'Z' are not guaranteed to be consecutive, but '0' to '9' are.

    Without either ASCII or EBCDIC mentioned in the C90 standard.

    I was specifically talking about the ESCAPE character, which the C90
    committee ignored.

    Sure. Sorry - loose language. They were forced - begrudingly
    from what I think I remember I read - to consider the mainframe
    implications. And most couldn't understand why the mainframe
    was so complicated, with record formats etc.

    Regardless, that's what I'm after - a decision on how to do it.
    If you personally don't want to spend the time and effort and/or
    make a decision, that's fine - I'm hoping someone in the group
    will do that, and perhaps when they propose a solution you will
    chime in and say "no, that's not a good idea for xyz reason".

    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.

    Disconnect. Not what I prefer. What the theoretical committee decides.

    This is intended to be in the official ISO C standard for the next
    1 million years.

    That will not happen.

    Actually influencing ISO is a separate exercise.

    That will not happen either.

    It probably won't involve coercion.

    But coercion wouldn't be required if the C90+ committee comes
    up with something reasonable.

    That sounds like a threat. If it is, I suggest you stick it where the
    sun don't shine. But as far as I know you have no ability to carry out
    your threat, so it's more pathetically amusing that frightening.

    [...]

    You can probably say that I have decided that future versions
    of C will only work on character sets that include an ESC
    character.

    That is not your decision to make. (Nor is it mine.)

    [...]

    And if I am one day elected president of the USA, at the
    same time as Chancellor of Germany, and a few other
    places, you may well find 90% of the planet using it (or
    at least, having it on their system).

    See above regarding "where the sun don't shine".

    [...]

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Fri May 23 12: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Fri May 23 12: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Fri May 23 12: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Fri May 23 14:27:15 2025
    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    [...]
    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.

    Yes, the current edition of POSIX requires INT_MAX to be at least
    2147483647, and CHAR_BIT to be exactly 8.

    Library and Language are inseparable.

    Depends on what you mean by "inseparable", I suppose. POSIX is unusual
    in its chumminess with the language.

    [...]

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Fri May 23 15: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

    [...]


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Fri May 23 15:20:13 2025
    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.

    A new library might be included in the standard if the committee decides
    that all conforming implementations must provide it. (Or it might be
    made optional.)

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Fri May 23 15: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

    [...]


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Fri May 23 22: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Fri May 23 23: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Richard Harnden@3:633/280.2 to All on Sat May 24 01: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?




    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: i2pn2 (i2pn.org) (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Sat May 24 02: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Sat May 24 02:57:23 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Sat May 24 03: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Sat May 24 03: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Sat May 24 04:10:35 2025
    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>.)

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Sat May 24 06: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Sat May 24 06: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Sat May 24 07:10:21 2025
    Reply-To: slp53@pacbell.net

    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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Sat May 24 07: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Sat May 24 07: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Sat May 24 08: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Sat May 24 09: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Sat May 24 10: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Sat May 24 12: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 ... ?

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Sat May 24 15: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).

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Sat May 24 15: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Sat May 24 15: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Sat May 24 15: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Sat May 24 15: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Sat May 24 18:27:46 2025
    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.

    If I had a time machine and sufficient influence, I might make all
    the errno macros start with something more distinct, like E_ or ERR.
    But I don't.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Sun May 25 15: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.)

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Mon May 26 07:54:10 2025
    "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)

    And here's a chance to clear up another point.

    It's none of those things.

    It's the other way around.

    I am religiously conforming to C90 and making all my tools, and my
    OS, to C90.

    I have been doing this for nearly 40 years.

    Even when people complained about MSDOS being "different",
    I didn't see any difference. I basically told them that they were
    wrong. The implementation they were using was conformant
    with the ANSI C draft - it's up to them to adjust, not MSDOS
    nor anything else. If they write their software "properly", it will
    work not just on MSDOS, but also on MVS.

    At the time I didn't know why people were plastering "near"
    and "far" keywords everywhere. In fact, I basically still don't.
    I simply choose an appropriate memory model.

    And I can remember talking to a long-term DOS programmer
    who stated that you couldn't do xyz without doing a BIOS
    call or directly manipulating the hardware. xyz might have
    been getting a single character from the keyboard. And I said
    no, you can get that with a standard read. You just need to
    do this devioctl call first.

    So that is the background. I just chose to follow C90,
    religiously.

    But the irony is I don't really have that as a religion - it
    just appears that way.

    When I understood the limits of C90, I had no religious
    qualms about changing/forking C90. Only practical.

    It has taken me nearly 40 years to find those limits.

    And now I am hitting those limits.

    E.g. I can't drive an EBCDIC X3.64 terminal unless C90
    provides an ESC define.

    And I can't do a "dir" either.

    And nor can I do a non-blocking peep.

    So now, belatedly, I am revisiting the C90 standard and
    asking about its limits, and whether they should exist and
    why they should exist.

    All this time that I was "investigating", the ISO C and most
    of the world had raced ahead, invalidating 36-bit machines,
    invalidating MVS (as they always had anyway), etc.

    I am now - belatedly - challenging that path of "development".

    It doesn't really matter to me whether I actually succeed in
    being more popular than the ISO strain of "development".

    What matters to me is whether C90+ or C90-refined is
    logical. And only if the C90 standard is sufficiently forked -
    because it is logical to do so - can I say my ecosystem is
    "completely portable".

    That's what C90 is all about after all - making things as
    completely portable as possible.

    My #define ESCAPE 0x1b is not portable. It won't work
    on EBCDIC. And crucially - it won't work on some other
    theoretical character set - even if it includes an ESC.

    So I have reached the limits of C90, and something has
    to give. Or it is "time for something to give".

    There are two ways to go.

    I could say "ANSI x3.64 terminals cannot be supported
    in a portable manner, and so I will use edlin for the rest
    of my life".

    Or I could say "change C90 so I can use microemacs".

    I'm happy to change (or work on changing) the entire
    mainframe ecosystem to switch from 3270 terminals
    to EBCDIC ANSI terminals.

    Actually succeeding in doing that (with or without
    coercion), is a separate exercise. And I don't really
    care if it happens or succeeds.

    What I care about is that I made a logical attempt to
    do so, which justifies my use of microemacs instead
    of edlin.

    At the end of the day, I'm trying to run microemacs,
    while sticking to my principle of being standards-conforming.

    I'm trying to run microemacs, not win Miss America.

    I can demonstrate microemacs running on a mainframe.
    So I know it is technically possible.

    But it violates C90 and there is currently no C90+ I can
    point to instead that my flavor of microemacs conforms to.

    That's the issue.

    If I had a C90+ I can start off by saying "the entire rest
    of the world is wrong and I am right for following C90+
    instead of C90 or a derivative".

    To the person who said I should write to convey, not
    convince - I'm not trying to convince anyone. I don't
    care if no-one in the world moves to C90+ except me.
    I'm just after the technical information required to
    write C90+.

    Making sure the identifier doesn't start with "E" is one
    example of that. I wouldn't have thought of that myself.

    I believe I will need some more identifiers for the
    microemacs keystrokes too - like ctrl-x, ctrl-s to save.

    The alternative (for me) is grim.

    edlin

    That's convey. Not convince.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Mon May 26 08:12:03 2025
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87y0uot8b7.fsf@nosuchdomain.example.com...
    "Paul Edwards" <mutazilah@gmail.com> writes:

    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.

    (I didn't previously state this, because I wasn't aware
    of it, again)

    I don't believe

    You are correct to nuance things - an acknowledgement
    that you can't predict the future with 100% certainty.

    that you personally will have any influence over any
    future C standard. Your goals are too different from the goals of the committee and those of the vast majority of people who care about C.

    To me - this is a "mere challenge".

    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, 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.

    In my opinion that will never happen.

    I am discussing a theoretical possibility, not making a
    hard prediction.

    I have no problem with whatever functionality you want to provide in
    your PDPCLIB, and I'm willing to discuss some of it in technical terms.

    Sure, thanks.

    It's just a library. It may or may not
    depend on features of the C90 standard library.

    No. It IS C90+.

    I don't know what you mean by that. If you mean that your PDPCLIB
    library IS "C90+", that's fine; both are your invented terms.
    But it's an odd choice of terminology.

    You are guessing what I am talking about, so I will try to
    explain.

    No. PDPCLIB *will be* one of the possible theoretical
    implementations of C90+.

    Right now, it is pure C90.

    Because right now, C90+ doesn't exist.

    As such, there is no ESCAPE or any other define in any existing
    or new header in PDPCLIB.

    And that's the problem - I don't know where to add it.
    As it turns out, the "defacto vague committee" made a
    determination that "ESCAPE" is not an appropriate
    name. I agree with the other members of the committee,
    and the original proposer - ie you - agreed with that
    "good catch".

    That's a pretty good result to me.

    If the other control characters are necessary for the
    operation of microemacs - which I believe they are -
    more than just ESCAPE needs to be added anyway.

    Which header file and what names - that don't start
    with "E"?

    This is intended to be in the official ISO C standard for the next
    1 million years.

    That will not happen.

    Even assuming that non-ESCAPE is never added to the
    ISO C standard - and I'm not sure how you can predict
    that - that doesn't stop it from being my INTENTION.

    Actually influencing ISO is a separate exercise.

    That will not happen either.

    What do you mean by that? Not one single member of
    the ISO committee will ever be influenced by a single
    thing I say? Even if I join the committee myself? Even if
    I bribe them? Even if I coerce them? Even if I stack the
    ISO committee with my friends (after making some
    friends - or bribing some people)?

    It probably won't involve coercion.

    But coercion wouldn't be required if the C90+ committee comes
    up with something reasonable.

    That sounds like a threat. If it is, I suggest you stick it where the
    sun don't shine. But as far as I know you have no ability to carry out
    your threat, so it's more pathetically amusing that frightening.

    You are correct that I have no ability to coerce anyone at all.
    Nor do I wish to do so even if I did. Nor did I even say it was
    required.

    It is a theoretical possibility.

    Don't assume you can predict the future.

    It never ever occurred to me that a US president would one
    day mull over invading an erstwhile ally (Denmark) in order
    to annex some territory (Greenland), that they are already on
    as invited guests.

    And if I am one day elected president of the USA, at the
    same time as Chancellor of Germany, and a few other
    places, you may well find 90% of the planet using it (or
    at least, having it on their system).

    See above regarding "where the sun don't shine".

    I only need 51% of the vote, not 100% of the vote.

    And I only said that 90% of the planet may be using
    my ecosystem, not 100%.

    You have no personal control over either those 51% or
    those 90%.

    We're both lobbying for their support.

    "Don't vote for Paul - he's going to replace the ISO
    C committee just so that he can run microemacs!!!".

    I don't think most voters will care as much about that
    issue as you apparently do. But we'll see ...

    And again - I don't actually care if I succeed. I'm happy
    to have just tried.

    Did you see "One Flew Over the Cuckoo's Nest"?

    The guy tries to lift the water cooler. It doesn't really
    bother him that he failed.

    A big Indian guy succeeded.

    Maybe one day a big Indian guy will read comp.lang.c
    and complete what I was unable to complete.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Mon May 26 08:29:05 2025
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]
    E.g. I can't drive an EBCDIC X3.64 terminal unless C90
    provides an ESC define.
    [...]

    Of course you can. 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).

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

    [...]
    That's what C90 is all about after all - making things as
    completely portable as possible.
    [...]

    No, that's not what C90 was ever about. Very few C programs are
    completely portable, because they don't need to be.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Mon May 26 08:31:46 2025
    "Paul Edwards" <mutazilah@gmail.com> wrote in message news:10103i7$1jdii$1@dont-email.me...

    That's convey. Not convince.

    Oh yeah - an more "conveying".

    I am happy to invalidate the last (2025-1999) years of
    software that you wrote, with no moral qualms, the same
    way as you have no moral qualms about invalidating
    beautiful 36-bit machines every time you write int32_t,
    and invalidate beautiful MVS every time you #include
    unistd.h because there is no C90 function to do what
    you want, and you didn't propose a C90+ to add one,
    and you just insist MVS doesn't exist either way.

    Or use the term "not relevant today".

    There's the battle lines right there.

    I'm not particularly expecting to win, but I was thinking
    36-bit machines would be useful to me so that I can
    support a variation of VISCII without needing to take
    over control characters. I would be happy to take over
    control characters, but that was until I found that I
    probably need the box-drawing characters from code
    page 437 too.

    Post-edlin is microemacs. Post-microemacs is a text
    windowing system.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Mon May 26 08:34:12 2025
    "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.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Mon May 26 08:40:50 2025
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:87a570jpe6.fsf@nosuchdomain.example.com...
    "Paul Edwards" <mutazilah@gmail.com> writes:
    [...]
    E.g. I can't drive an EBCDIC X3.64 terminal unless C90
    provides an ESC define.
    [...]

    Of course you can.

    I'm not disputing that it is physically possible.

    You're misinterpreting my "can't". I was going to say "you
    know what I mean", but maybe you don't.

    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.

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

    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.

    That's what C90 is all about after all - making things as
    completely portable as possible.

    No, that's not what C90 was ever about. Very few C programs are
    completely portable, because they don't need to be.

    I dispute the "don't need to be".

    And even if you insist that about everyone else, it doesn't
    apply to me.

    I want my programs to be "completely portable", meaning
    "conform to hosted C90 rules" or "conform to hosted C90+
    rules". Those are the only two choices.

    Also - something else I didn't mention.

    Even if I got my C90+ changes into a future C30 standard -
    that's still not good enough. Whether it takes C40, or C50,
    or C60000000 - one day I intend for it to align with C90+.

    If that means invalidating 60 million years worth of C
    development - so be it. You should have read comp.lang.c
    in 2025. It was always an OOB question.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Mon May 26 09:01:54 2025
    "Keith Thompson" <Keith.S.Thompson+u@gmail.com> wrote in message news:875xhojp5n.fsf@nosuchdomain.example.com...

    And if you want to talk
    about coercing or bribing members of the C committee or any similar antisocial behaviors

    I'm not really antisocial. They are theoretical possibilities
    that can't be ruled out. No matter how absurd you believe
    them to be - and I would tentatively agree - but I have
    been burnt too many times to pretend that I can predict
    the future.

    In more practical terms, it is as per the original article I
    posted from Jeff. He - like me - believes that the IT
    industry is a case of the inmates are running the asylum.

    I sense an opportunity - possibly a commercial opportunity -
    here.

    The existing software is too complicated to maintain, and
    systems are failing. Have you seen the movie "Idiocracy"?
    I believe it is already happening.

    PDOS is basically as simple as I can make it. That also
    means it has the most chance of being maintainable.

    The supporting infrastructure has one thing that is too
    complicated to maintain - gcc.

    That can currently be treated as a black box. cc64 is
    in the same boat.

    We have been attempting for years/decades to stand
    up a replacement, but it hasn't happened yet.

    At some point I may be able to run bank software,
    where my bank software is on a fully understood by
    normal programmers - not a few freaks that are dying
    out - system, and so some bank that uses my software
    is more competitive than other banks that use the
    latest 2048-bit system with 5000 Tbps fiber optic
    connections, that is permanently broken at the software
    side - or even if it is on the hardware side - no-one
    can detect that, because they can't prove - or even
    report - it - via software - to the hardware engineers
    so that they can correct it.

    I've seen that first hand. On a POSIX system, we were
    getting intermittent hangs on the software side. And I
    think we didn't even know whether it was on the disk
    or network side.

    I told them this is not something for us application
    programmers to solve - we need systems programming
    support, who will then liase with the OS, 3rd party
    software, and hardware manufacturers as required.

    "what's a system programmer?".

    (that's a term familiar on MVS)

    It was a complete clown show. Again - I'm not alone.
    Jeff in the original link expressed it very nicely.

    I think it was solved when multiple bits of third party
    software were downgraded.

    As far as I know, the problem was never isolated and
    reported to a vendor.

    Certainly whenever Windows freezes on me, I don't
    report it to Microsoft.

    You can report PDOS bugs to me easily though, and
    at least to date, they are investigated without charge.

    You can sort of do that with any bugs in MVS (z/OS)
    too.

    That's the only competitor to PDOS I'm aware of,
    and indeed, I would encourage you to use my
    competitor, rather than PDOS, for now.

    I am already aware that your (non-specific reader)
    mileage varies, but you're welcome to repeat that
    anyway. And it will be ignored, as usual. I already
    know we (non-specific) have different goals too.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kenny McCormack@3:633/280.2 to All on Mon May 26 09: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: The official candy of the new Millennium (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Mon May 26 09:48:46 2025
    "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.

    I may well be a minority, but I don't have a need to support
    Unicode. I'm more interested in a modified VISCII than
    Unicode.

    fgetc() won't hang on a single character in either case.

    And I consider it to be useful, even if I am literally alone,
    and remain alone forever. I can't prove that I'm alone
    though. I have no idea who is "out there".

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Mon May 26 10: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Mon May 26 11: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

    [...]


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Mon May 26 11: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Mon May 26 11:46:32 2025
    "Janis Papanagnou" <janis_papanagnou+ng@hotmail.com> wrote in message news:1010g5b$1lr7o$1@dont-email.me...
    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?

    That's not part of C90, nor even C23.

    Which means there are lot of compilers - some of which I still use -
    that don't have that, and are never likely to be updated - even
    with a patch.

    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'.

    Yes - had they done that.

    Even then, I still need control characters for microemacs.

    (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.)

    I'm expecting to be defined through a header file.

    Not necessarily one of the ones that already exist in C90.

    Not necessarily not, either.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Mon May 26 11:50:30 2025
    "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:

    "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.

    Which is one solution to the problem.

    Just not a solution I agree with.

    I prefer VISCII-like, possibly requiring a 9-bit char, and
    invalidating all applications with POSIX assumptions.

    Other solutions could involve forcing everyone to use
    English. Another solution I'm not in favor of - at least
    not right now. I'm pretty happy with what C90 came
    up with. The standard was delayed for a year because
    of that, I believe I read.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From vallor@3:633/280.2 to All on Mon May 26 14:05:25 2025
    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."

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: ---:- FTN<->UseNet Gate -:--- (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Mon May 26 23: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Tue May 27 03: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Peter 'Shaggy' Haywood@3:633/280.2 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!!

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Wed May 28 00: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Michael S@3:633/280.2 to All on Wed May 28 01: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Wed May 28 03: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Wed May 28 09: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Wed May 28 09: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. :)

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Wed May 28 22: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).

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Michael S@3:633/280.2 to All on Wed May 28 23: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Wed May 28 23: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Thu May 29 08: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Thu May 29 17: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?

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Thu May 29 17: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” ...

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Thu May 29 17: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Thu May 29 18: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Thu May 29 18: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Thu May 29 19: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?

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Thu May 29 20: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Thu May 29 22: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Thu May 29 22: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Fri May 30 01:06:40 2025
    Reply-To: slp53@pacbell.net

    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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Fri May 30 01:08:10 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Fri May 30 02: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Fri May 30 02: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Fri May 30 03: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Fri May 30 03: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Fri May 30 03: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Fri May 30 05: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Michael S@3:633/280.2 to All on Fri May 30 06: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: =20
    On Fri, 23 May 2025 23:13:20 +0100, Richard Heathfield wrote:
    =20
    And who cares about future instability if C90 remains just as
    stable as ever it was? =20

    Even with the problems with const?

    =A0=A0=A0=A0 char *strstr(const char *haystack, const char *needle);

    Dennis Ritchie pointed out the trouble with that. =20
    =20
    Is C90 perfect? No, of course not. "C is quirky, flawed, and an
    enormous success."
    =20
    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.
    =20
    =20
    That's one of the reasons I like C99 and C11, and look forward to
    C23. Once implemented, they don't change either.
    =20
    I agree with all your are arguments on this, except for one - I can't=20 understand why you think C90 is different from later C standards in
    this regard.
    =20

    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.




    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Fri May 30 06: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Fri May 30 06:45:16 2025
    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.

    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? C99 is also exactly the same as itself.

    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).

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Fri May 30 07: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Fri May 30 07:19:44 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Chris M. Thomasson@3:633/280.2 to All on Fri May 30 07:29:23 2025
    On 5/29/2025 5:41 AM, Richard Heathfield wrote:
    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?


    ROFL!!!

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Chris M. Thomasson@3:633/280.2 to All on Fri May 30 07:31:06 2025
    On 5/29/2025 9:36 AM, Richard Heathfield wrote:
    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.


    The Amish, from Family Guy:

    https://youtu.be/-wlwtpH1ldM

    LOL! They are quite efficient!

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Fri May 30 07: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Fri May 30 07:50:13 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.

    I hope that was a typo. If you really meant that C99 is different from
    C99, I suggest that requires a bit more explanation.

    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'.

    Right, there's a lot of existing C90 code out there, and we need
    both C90 compilers and programmers who are familiar with C90
    to maintain it. The alternative of updating it to conform to a
    later C standard is often impractical (and the update would also
    require programmers who know C90). I don't recall anyone suggesting
    otherwise. ISO has decreed that each edition "cancels and replaces"
    the previous edition, but none of us are obligated to accept that.

    If I were starting a new project in C, I would not consider
    using C90. At this point, I'd probably use C11 (perhaps with
    compiler-specific extensions depending on the details of the
    project).

    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. If that's an accurate summary of your opinion,
    can you explain it? And if it isn't, just what are we talking about?

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Fri May 30 09: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Waldek Hebisch@3:633/280.2 to All on Fri May 30 12: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: To protect and to server (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Fri May 30 13: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Fri May 30 13: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Fri May 30 17: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Fri May 30 18:18:43 2025
    "Scott Lurndal" <scott@slp53.sl.home> wrote in message news:Qb4_P.377135$vvyf.313049@fx18.iad...
    Richard Heathfield <rjh@cpax.org.uk> writes:

    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.


    And also except the most important, or second most
    important, compiler on the planet.

    (The competition for first place being IBM's C compiler for z/OS)


    C:\Program Files\Microsoft Visual Studio\2022\Professional>cl /?
    Microsoft (R) C/C++ Optimizing Compiler Version 19.41.34123 for x64
    Copyright (C) Microsoft Corporation. All rights reserved.

    ....

    -LANGUAGE-

    /std:<c++14|c++17|c++20|c++latest> C++ standard version
    c++14 - ISO/IEC 14882:2014 (default)
    c++17 - ISO/IEC 14882:2017
    c++20 - ISO/IEC 14882:2020
    c++latest - latest draft standard (feature set subject to change) /std:<c11|c17|clatest> C standard version
    c11 - ISO/IEC 9899:2011
    c17 - ISO/IEC 9899:2018
    clatest - latest draft standard (feature set subject to change)




    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Fri May 30 18:41:21 2025
    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:10191uh$3olom$2@dont-email.me...
    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?

    I'm not disputing advances in computer science. Three way diff
    would be my favorite.

    It then needs to be incorporated into a professional product.
    Which is properly funded, understood, someone has pride
    in the integrity of the product, and bugs reports are always
    addressed with professionalism - no matter what is required.
    Literally to the ends of the earth. If they ever needed more
    money to fix a bug, they'd just jack up the prices they charge.

    In other words, MVS (z/OS).

    I doubt that the original author (Jeff) was working on z/OS when
    he wrote about the shambles he saw.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Fri May 30 18:47:08 2025
    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:1019269$3olom$3@dont-email.me...
    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.

    They may not agree if they are suddenly exposed to resource constraints.

    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" ...

    Sort of. I'm going to have the only understandable, maintainable
    and maintained open source OS.

    When the appropriate resource constraints kick in - including
    the emerging lack of skilled programmers in Idiocracy, it will
    be a race to the bottom, where PDOS serves as a backstop.
    As designed.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Fri May 30 19: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Fri May 30 20: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Sat May 31 00: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.)


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Sat May 31 01: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Sat May 31 01: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?

    :-)



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Sat May 31 01: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.




    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Harnden@3:633/280.2 to All on Sat May 31 02:25:12 2025
    Reply-To: nospam.harnden@invalid.com

    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/



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Sat May 31 02: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Sat May 31 02: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Sat May 31 02: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Sat May 31 04: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Sat May 31 08: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Sat May 31 16:20:33 2025
    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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Sun Jun 1 07: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Sun Jun 1 15:58:54 2025
    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;


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Sun Jun 1 17: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Mon Jun 2 17:35:24 2025
    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 ?


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Tue Jun 3 01:24:45 2025
    Reply-To: slp53@pacbell.net

    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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From James Kuyper@3:633/280.2 to All on Tue Jun 3 09: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Tue Jun 3 09:54:53 2025
    Reply-To: slp53@pacbell.net

    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."

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Tue Jun 3 10: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Tue Jun 3 11: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Wed Jun 4 03:41:23 2025
    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 ?

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Wed Jun 4 04:25:17 2025
    Reply-To: slp53@pacbell.net

    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?


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Wed Jun 4 19:23:42 2025
    "Lawrence D'Oliveiro" <ldo@nz.invalid> wrote in message news:101dac8$mkpm$3@dont-email.me...
    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?

    I used to at one place I worked. Neither I nor the company
    were alone in the world.

    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.

    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.

    Yep - all locking you down to the most important platform
    in the world.

    If you want to be able to escape from this situation, in case
    IBM uses its monpoly to screw you over, you probably want
    to switch to IBM C, and code in C90, so that your
    institution can jump ship in that situation, as there are inferior
    systems waiting to accept your entire codebase.

    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!


    Watch this spot.

    D:\devel\pdos\pdpclib>grep EBCDIC makefile.p32
    makefile.p32: # define this if you are producing an EBCDIC to ASCII
    pseudo-bios
    makefile.p32: # char needs to be unsigned for EBCDIC so this should be

    D:\devel\pdos\pdpclib>

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Wed Jun 4 23:05:14 2025
    Reply-To: slp53@pacbell.net

    "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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Thu Jun 5 00:00:53 2025
    "Scott Lurndal" <scott@slp53.sl.home> wrote in message news:ewX%P.70348$ZDN7.23298@fx35.iad...
    "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.

    Can you tell me what CPU is being used on the EBCDIC
    systems? Is it the one where C is basically impossible to
    implement, while COBOL is a good fit?

    Are they selling actual CPUs or are they using emulation?

    If using emulation, I may as well emulate an IBM mainframe.
    There is a commercial z/Arch emulator already.

    Thanks. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Thu Jun 5 01: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From =?UTF-8?Q?Josef_M=C3=B6llers?=@3:633/280.2 to All on Thu Jun 5 04: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: ---:- FTN<->UseNet Gate -:--- (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Thu Jun 5 04:58:23 2025
    "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?

    And how do you expect Windows 10/11 to find "test1.dat" -
    all EBCDIC on its current ASCII filesystem?

    And I would want the data to remain in EBCDIC for
    easy transportation, so if I do:

    fopen("output.txt", "w")
    I expect that file to remain in EBCDIC, so that it can be
    opened with "rb" by zip.


    You could indeed statically link a C library that takes care
    of all that - with EBCDIC to ASCII conversion happening
    on just filenames and the stdin/stdout/stderr streams.

    Or you could have a dynamic C library and OS (possibly
    combined) that sits between your app and the Windows OS
    so that things are more reasonable.

    And either way, you will need the supporting 80386 EBCDIC
    Win32 toolchain to make it work. You would need someone
    (or some people) really bloody-minded to sit down and
    assemble all the required infrastructure over years, indeed
    decades, to make it all work.

    Fortunately the internet is big enough to find all the required
    people to make it happen.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Thu Jun 5 05: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Thu Jun 5 05:24:17 2025
    "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?

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Thu Jun 5 07:09:13 2025
    Reply-To: slp53@pacbell.net

    =?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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Thu Jun 5 07: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Thu Jun 5 09: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).

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Thu Jun 5 09:48:20 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Thu Jun 5 16:18:27 2025
    On 04/06/2025 20:48, Josef Mllers 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.




    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From David Brown@3:633/280.2 to All on Thu Jun 5 16: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?


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Thu Jun 5 19:28:53 2025
    "David Brown" <david.brown@hesbynett.no> wrote in message news:101rdli$1cb3a$2@dont-email.me...
    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.

    With my application programmer's hat on, I have already
    written the code, it is already C90-compliant, and no, I
    don't want to change my code.

    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?

    It's not for you to send a file.

    It's for an enterprise - suddenly forced off the mainframe -
    to carry on, on a different machine, with no data conversion,
    and no code changes, because they took the precaution of
    writing in C90.

    And all running at native speed on the new x64 processor.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Thu Jun 5 19:31:38 2025
    "Kaz Kylheku" <643-408-1753@kylheku.com> wrote in message news:20250604142536.604@kylheku.com...
    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".

    The OS - PDOS-generic - does (or can) "match the requirement".

    The underlying Windows 10/11 system is converted into
    nothing more than a glorified BIOS, ie pseudo-bios, which
    PDOS-generic can then run under.

    No emulation. Native x64 speed. EBCDIC.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Paul Edwards@3:633/280.2 to All on Thu Jun 5 20:25:37 2025
    "David Brown" <david.brown@hesbynett.no> wrote in message news:101rdli$1cb3a$2@dont-email.me...

    Maybe if you actually wanted to contribute something useful to the C
    world - something that other people might find useful

    I'm not trying to win Miss America.

    I'm trying to make C90 - or a slight variation - that e.g.
    would include directory operations, hence the title,
    actually "work as designed".

    None of this nonsense about "real world programs
    can't be written in C90".

    Instead, if someone complains about IBM's monopoly, I
    just want to be able to respond "well maybe you should
    have written your app in C90. If you had, you could have
    moved your entire application, completely unchanged,
    with a simple recompile".

    Previously people could have said "It's not a simple
    matter of recompilation - you need to migrate the
    data from EBCDIC to ASCII too".

    And even further back than that, they would have said
    something along the lines of "IBM files are record-based
    and cannot be migrated".

    I never really understood the comment about being
    record-based. Took a long time to find out they were
    talking about the Loch Ness Monster.

    And the "-m31" (instead of -m32) option of gcc was
    another Loch Ness Monster.

    It took a long time to drain Loch Ness once and for all.

    And bring IBM mainframes in from the cold.

    BFN. Paul.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Waldek Hebisch@3:633/280.2 to All on Fri Jun 6 13: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: To protect and to server (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Fri Jun 6 18:29:12 2025
    Am 03.06.2025 um 20:25 schrieb Scott Lurndal:
    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?

    Because you can have it easier than with opendir() / readdir().


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Sat Jun 7 00:10:07 2025
    Reply-To: slp53@pacbell.net

    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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Sat Jun 7 03:10:13 2025
    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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Sat Jun 7 03:24:50 2025
    Reply-To: slp53@pacbell.net

    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 :-).

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Sat Jun 7 03:26:51 2025
    Am 06.06.2025 um 19:24 schrieb Scott Lurndal:
    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.

    It results in much less code. Just like a lambda passed
    to std::sort() which takes context of the calling function.

    In any case, nftw is a C function and C doesn't support lamda functions.

    Lambdas without capture can be converted to C function-pointers.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From wij@3:633/280.2 to All on Sat Jun 7 06:04:24 2025
    On Fri, 2025-06-06 at 19:26 +0200, Bonita Montero wrote:
    Am 06.06.2025 um 19:24 schrieb Scott Lurndal:
    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:
    =20
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The fchownat() functio=
    n shall be equivalent to the chown() and lchown()
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 functions except in th=
    e case where path specifies a relative path. In
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 this case the file to =
    be changed is determined relative to the directory
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 associated with the fi=
    le descriptor fd instead of the current working
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 directory. If the acce=
    ss mode of the open file description associated
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 with the file descript=
    or is not O_SEARCH, the function shall check
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 whether directory sear=
    ches are permitted using the current permissions
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 of the directory under=
    lying the file descriptor. If the access mode is
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 O_SEARCH, the function=
    shall not perform the check.
    =20
    And why is this relevant for directory_iterator or recursive_directory_iterator ?
    =20
    Why are you asking this question on comp.lang.c?
    =20
    Because you can have it easier than with opendir() / readdir().
    =20
    Personally, I'd use nftw to iterate over a path.
    =20
    https://pubs.opengroup.org/onlinepubs/9799919799/functions/nftw.htm=
    l
    =20
    That would be much nicer with a lambda which can take the context
    of the calling function.
    =20
    =20
    That's a matter of opinion.
    =20
    It results in much less code.=C2=A0

    That is illusion, particularly in this case (about directory).
    Most serious programs will 'invent' their own functions, even their own
    'sugar syntax'... result would be better than 'directory_iterator'.
    In general, no need for such things as 'directory_iterator' in C-library.

    Just like a lambda passed
    to std::sort() which takes context of the calling function.
    =20
    In any case, nftw is a C function and C doesn't support lamda functions=
    ..
    =20
    Lambdas without capture can be converted to C function-pointers.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Sat Jun 7 10: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Sat Jun 7 10: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Sat Jun 7 14:24:53 2025
    Am 06.06.2025 um 22:04 schrieb wij:
    On Fri, 2025-06-06 at 19:26 +0200, Bonita Montero wrote:
    Am 06.06.2025 um 19:24 schrieb Scott Lurndal:
    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.

    It results in much less code.

    That is illusion, particularly in this case (about directory).

    I've shown the code. In C++17 iterating through a single directory and
    printing it is two lines of code.

    Most serious programs will 'invent' their own functions, even their own 'sugar syntax'...

    Not to iterate through a directory in C++.

    'sugar syntax'... result would be better than 'directory_iterator'.

    Why ?

    In general, no need for such things as 'directory_iterator' in C-library.


    In C you're forced to write ten times the code if you include error
    handling.

    Just like a lambda passed
    to std::sort() which takes context of the calling function.

    In any case, nftw is a C function and C doesn't support lamda functions.

    Lambdas without capture can be converted to C function-pointers.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From wij@3:633/280.2 to All on Sat Jun 7 21:58:01 2025
    On Sat, 2025-06-07 at 06:24 +0200, Bonita Montero wrote:
    Am 06.06.2025 um 22:04 schrieb wij:
    On Fri, 2025-06-06 at 19:26 +0200, Bonita Montero wrote:
    Am 06.06.2025 um 19:24 schrieb Scott Lurndal:
    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:
    =20
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The fchownat=
    () function shall be equivalent to the chown() and lchown()
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 functions ex=
    cept in the case where path specifies a relative path. In
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 this case th=
    e file to be changed is determined relative to the directory
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 associated w=
    ith the file descriptor fd instead of the current working
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 directory. I=
    f the access mode of the open file description associated
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 with the fil=
    e descriptor is not O_SEARCH, the function shall check
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 whether dire=
    ctory searches are permitted using the current permissions
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 of the direc=
    tory underlying the file descriptor. If the access mode is
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 O_SEARCH, th=
    e function shall not perform the check.
    =20
    And why is this relevant for directory_iterator or recursive_directory_iterator ?
    =20
    Why are you asking this question on comp.lang.c?
    =20
    Because you can have it easier than with opendir() / readdir(=
    ).
    =20
    Personally, I'd use nftw to iterate over a path.
    =20
    https://pubs.opengroup.org/onlinepubs/9799919799/functions/nftw=
    ..html
    =20
    That would be much nicer with a lambda which can take the context
    of the calling function.
    =20
    =20
    That's a matter of opinion.
    =20
    It results in much less code.
    =20
    That is illusion, particularly in this case (about directory).
    =20
    I've shown the code. In C++17 iterating through a single directory and printing it is two lines of code.

    C has to deal with hardware, that is all the basic (C++ and other languages=
    are
    fundamentally the same).
    There are 'tons' of details to consider, e.g. in multi-user/tasking conditi= on.

    Most serious programs will 'invent' their own functions, even their own 'sugar syntax'...
    =20
    Not to iterate through a directory in C++.
    =20
    'sugar syntax'... result would be better than 'directory_iterator'.
    =20
    Why ?

    There are many kinds of 'sub-languages' that can do any specific job better=
    ..
    As said, C is the basic. Actually, IMO, C++ could be better than C, but C++ invented 10 times more possibility of doing things wrong (because most are duplications).

    In general, no need for such things as 'directory_iterator' in C-librar=
    y.
    =20
    =20
    In C you're forced to write ten times the code if you include error
    handling.

    C++ is no better, probably worse. Firstly, the term 'exception' (and
    'vector' probably) is disabled in human mind to think about exception.
    C++ had been trying to HIDE error (exception) from its beginning, very wron=
    g
    and very unsuccessful.

    Snipet from https://sourceforge.net/projects/cscall/files/MisFiles/ClassGui= delines.txt/download
    -------- Returning error and the error checking
    Error (branching point information) not handled is always a hiden 'UB' wai= ting
    to happen. The guideline is: ALWAYS CHECK THE ERROR. This guideline extend=
    s to
    API, therefore, "__attribute__((warn_unused_result))" should be added to t=
    he
    returning Errno. As usual, exception exists.

    From function usage point of view: The general concern of error checking m=
    ay
    be the complexity and readibility of the source codes. In this guidelines'
    view, without the checking and handling of the error, the evaluation
    (readibility, beauty,..) of the codes is one-sided judgement, because erro=
    r
    checking and handling is part of the complete program or (function). The A=
    PI
    can always move the 'unwelcome' one to somewhere, but the machine sees
    everything.
    The minimum check-and-throw pattern is better than ignoration, such coding
    (throw) is equivalent to a blended cheap-and-better assert.
    Practice proves that error checking actually reduces software development = and
    maintenance time, significantly.

    Notice the term 'branching point', errors are merely branching points.
    For a progam to be shorter/simpler as desired, how many branching points ar= e=20
    handled? What is 'convenience' based on, ignorance?

    Just like a lambda passed
    to std::sort() which takes context of the calling function.
    =20
    In any case, nftw is a C function and C doesn't support lamda funct=
    ions.
    =20
    Lambdas without capture can be converted to C function-pointers.
    =20


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Sun Jun 8 02:31:35 2025
    Am 07.06.2025 um 13:58 schrieb wij:

    C++ is no better, probably worse. Firstly, the term 'exception' (and
    'vector' probably) is disabled in human mind to think about exception.

    I deal with exceptions every day and I've no problems with that. C++
    exceptions aren't that clean like Java exceptions, but still make much
    less work than C return code handling.

    C++ had been trying to HIDE error (exception) from its beginning, very wrong and very unsuccessful.

    Exceptions are the cleanest way of error handling. In most cases you
    deal with the error in a higher function and not in the leaf of the
    call graph; therefore exceptions are perfect.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From wij@3:633/280.2 to All on Sun Jun 8 04:43:25 2025
    On Sat, 2025-06-07 at 18:31 +0200, Bonita Montero wrote:
    Am 07.06.2025 um 13:58 schrieb wij:
    =20
    C++ is no better, probably worse. Firstly, the term 'exception' (and 'vector' probably) is disabled in human mind to think about exception.
    =20
    I deal with exceptions every day and I've no problems with that. C++ exceptions aren't that clean like Java exceptions, but still make much
    less work than C return code handling.

    The error from opendir(..):

    EACCES Permission denied.
    EBADF fd is not a valid file descriptor opened for reading.
    EMFILE The per-process limit on the number of open file descriptors=
    has
    been reached.
    ENFILE The system-wide limit on the total number of open files has = been
    reached.
    ENOENT Directory does not exist, or name is an empty string.
    ENOMEM Insufficient memory to complete the operation.
    ENOTDIR name is not a directory.
    ...

    Those are just common errors, there are actually more, and more from subseq= uent
    read/write/.... File operations (particularily directory) are actually very=
    nasty.

    I think your 'less work' was from simplication or idealization, lots are=
    =20
    simplified and idealized. =20
    We have no problem is because our average programs don't need to handle tho= se=20
    individual errors, but C's major task is to build OS, not average applicati= ons.

    C++ had been trying to HIDE error (exception) from its beginning, very =
    wrong
    and very unsuccessful.
    =20
    Exceptions are the cleanest way of error handling.=C2=A0

    Conditional. As said 'simplified'.

    In most cases you
    deal with the error in a higher function and not in the leaf of the
    call graph; therefore exceptions are perfect.

    If you can handle errors that way, C can also do it in much simpler way.
    The basic problem of throwing error is losing error context, it is similar
    to set a global errno (or object) and cause the program to stack unwind.

    C++ has many artificial fancy things and encourages such programming style. Good or bad? Both, but I would say mostly bad.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Sun Jun 8 05:22:49 2025
    Am 07.06.2025 um 20:43 schrieb wij:

    The error from opendir(..):

    EACCES Permission denied.
    EBADF fd is not a valid file descriptor opened for reading.
    EMFILE The per-process limit on the number of open file descriptors has
    been reached.
    ENFILE The system-wide limit on the total number of open files has been
    reached.
    ENOENT Directory does not exist, or name is an empty string.
    ENOMEM Insufficient memory to complete the operation.
    ENOTDIR name is not a directory.
    ...

    With C++ that's all encapsulated in filesystem_error which is derived
    from system_error. But you can omit permission denied errors with directory_options::skip_permission_denied. That makes sense mostly
    with recursive_directory_iterator. If you want to to that in C you've
    at least ten times the code.

    I think your 'less work' was from simplication or idealization, lots are simplified and idealized.

    No, show me your C code to iterate through a directory and I show you
    the same code with up to a fifth of C++-code. When you iterate
    recur-sively that's a tenth of the code.

    If you can handle errors that way, C can also do it in much simpler way.

    Absolutely not.

    The basic problem of throwing error is losing error context, it is similar
    to set a global errno (or object) and cause the program to stack unwind.

    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).

    C++ has many artificial fancy things and encourages such programming style. Good or bad? Both, but I would say mostly bad.

    C is bad, because you've to do simple things over and over with multiple
    times the code because there are no language-facilities to abstract your coding.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From wij@3:633/280.2 to All on Sun Jun 8 05:56:47 2025
    On Sat, 2025-06-07 at 21:22 +0200, Bonita Montero wrote:
    Am 07.06.2025 um 20:43 schrieb wij:
    =20
    The error from opendir(..):
    =20
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 EACCES Permission denied. =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 EBADF=C2=A0 fd is not a vali=
    d file descriptor opened for reading.
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 EMFILE The=C2=A0 per-process=
    limit on the number of open file descriptors has
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
    =A0=C2=A0=C2=A0 been reached.
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ENFILE The system-wide limit=
    on the total number of open files has=C2=A0 been
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
    =A0=C2=A0=C2=A0 reached.
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ENOENT Directory does not ex=
    ist, or name is an empty string.
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ENOMEM Insufficient memory t=
    o complete the operation.
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ENOTDIR name is not a direct=
    ory.
    =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ...
    =20
    With C++ that's all encapsulated in filesystem_error which is derived
    from system_error. But you can omit permission denied errors with directory_options::skip_permission_denied. That makes sense mostly
    with recursive_directory_iterator.=C2=A0

    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.
    I am not familiar with C++ std lib, I cannot say much.

    If you want to to that in C you've
    at least ten times the code.
    =20
    I think your 'less work' was from simplication or idealization, lots ar=
    e
    simplified and idealized.
    =20
    No, show me your C code to iterate through a directory and I show you
    the same code with up to a fifth of C++-code. When you iterate=20 recur-sively that's a tenth of the code.
    =20
    If you can handle errors that way, C can also do it in much simpler way=
    ..
    =20
    Absolutely not.
    =20
    The basic problem of throwing error is losing error context, it is simi=
    lar
    to set a global errno (or object) and cause the program to stack unwind=
    ..
    =20
    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).
    =20
    C++ has many artificial fancy things and encourages such programming st=
    yle.
    Good or bad? Both, but I would say mostly bad.
    =20
    C is bad, because you've to do simple things over and over with multiple times the code because there are no language-facilities to abstract your coding.

    Most of the above replies are false owing from narrow view. I'll save my explanations.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Janis Papanagnou@3:633/280.2 to All on Sun Jun 8 07: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Sun Jun 8 07:57:12 2025
    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.
    I am not familiar with C++ std lib, I cannot say much.

    LOL




    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Sun Jun 8 18:06:58 2025
    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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Muttley@DastardlyHQ.org@3:633/280.2 to All on Sun Jun 8 18: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From wij@3:633/280.2 to All on Mon Jun 9 00:52:41 2025
    On Sun, 2025-06-08 at 10:06 +0200, Bonita Montero wrote:
    Am 07.06.2025 um 21:56 schrieb wij:
    =20
    I see std::filesystem as evidence that C++ finally admits the deficienc=
    y of
    its advance error handling system (std::exception). But the result is w=
    orse
    =C2=A0> than C.
    =20
    That's just a mere assertion without any facts.

    I know a bit of the development of std::filesystem. The view of mere 'stand= ard'
    disregards fact and uses more the 'assertion' criticized.

    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,

    "dont' need" is illusion, errors are always there, mostly ignored and encou= raged
    to ignore by simplification.

    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.

    C has not hard coded what 'exception' should be. E.g. C can also set an err=
    or
    object and let interested code to handle it in many ways, what's left is im= pl.
    issues.

    But, I think the 'throw' mechanism (not std::exception) is good, like many others. 'throw' is more like a soft assert failure, which is no error handl= ing.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Mon Jun 9 01:02:08 2025
    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Mon Jun 9 01:06:44 2025
    Am 08.06.2025 um 16:52 schrieb wij:

    I know a bit of the development of std::filesystem. The view of mere 'standard'
    disregards fact and uses more the 'assertion' criticized.

    Another statement without arguments.

    "dont' need" is illusion, errors are always there, mostly ignored and encouraged
    to ignore by simplification.

    If the code is written to be exception-safe, i.e. it uses
    RAII throughout, then this is easily possible.

    C has not hard coded what 'exception' should be. E.g. C can also set an error object and let interested code to handle it in many ways, what's left is impl.
    issues.

    Are you serious? The fact that the exception type is transported along
    with the exception itself makes things really convenient. This way, the
    stack can be unrolled until the correct exception handler is found.

    But, I think the 'throw' mechanism (not std::exception) is good, like many others. 'throw' is more like a soft assert failure, which is no error handling.

    Totally different - asserts are handled at debug-time.
    Based on this statement, you didn't understand exceptions correctly.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Muttley@DastardlyHQ.org@3:633/280.2 to All on Mon Jun 9 01: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Mon Jun 9 01:11:54 2025
    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.

    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.

    You can easily define your own exception object with more context
    but for 95% of all exceptions bad_alloc or system_error fit.

    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.
    Most exceptions you throw or catch are bad_allocs or system_errors.
    With that you don't need any context. For the system_error it might
    make sense to catch them nearer to the call level where the error
    occured. Usually that happens with I/O-errors. But that still
    doesn't need the context of the individual I/O-operation.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Mon Jun 9 01:18:03 2025
    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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From wij@3:633/280.2 to All on Mon Jun 9 02:28:34 2025
    On Sun, 2025-06-08 at 17:06 +0200, Bonita Montero wrote:
    Am 08.06.2025 um 16:52 schrieb wij:
    =20
    I know a bit of the development of std::filesystem. The view of mere 's=
    tandard'
    disregards fact and uses more the 'assertion' criticized.
    =20
    Another statement without arguments.

    My primary interest of programming is on the theory. From your presented=
    =20
    wording, I don't think you can conduct a logical discussion (it seems you continue to ask for logical proof).

    "dont' need" is illusion, errors are always there, mostly ignored and e=
    ncouraged
    to ignore by simplification.
    =20
    If the code is written to be exception-safe, i.e. it uses
    RAII throughout, then this is easily possible.
    =20
    C has not hard coded what 'exception' should be. E.g. C can also set an=
    error
    object and let interested code to handle it in many ways, what's left i=
    s impl.
    issues.
    =20
    Are you serious? The fact that the exception type is transported along
    with the exception itself makes things really convenient. This way, the
    stack can be unrolled until the correct exception handler is found.
    =20
    But, I think the 'throw' mechanism (not std::exception) is good, like m=
    any
    others. 'throw' is more like a soft assert failure, which is no error h=
    andling.
    =20
    Totally different - asserts are handled at debug-time.
    Based on this statement, you didn't understand exceptions correctly.

    It seems your whole idea (and 'fact') is based on C++'s propaganda.

    Most of the related discussion have happened in the past I am lazy to repea= t.=20
    Just look at the fact, C++ is half-dying and accelerating (IMO, not because
    of bad but of trillions ways doing it wrong).
    You are repeating past errors and think your understanding and coding is=
    =20
    orthodox enough to be factually correct.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Mon Jun 9 02:55:50 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Mon Jun 9 02:58:24 2025
    Reply-To: slp53@pacbell.net

    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().

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Mon Jun 9 03: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Chris M. Thomasson@3:633/280.2 to All on Mon Jun 9 04:48:45 2025
    On 6/8/2025 9:58 AM, Scott Lurndal wrote:
    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.

    Exactly. If an allocation failed in some of my older server code, 20
    years ago for sure. Well, it would make the server go into a sort of
    "panic mode" and dump cache, dump timed out connections, ect, then it
    would try the allocation again. If that failed, it would go into shit
    hit the fan mode... ;^)


    Another fun aspect is in panic mode, instead of dumping timedout
    connections that are deemed worthy, I send them a special packet. It
    says, disconnect from me and connect to my friend server, here is the
    address and port.



    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().


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Mon Jun 9 06:05:59 2025
    Am 08.06.2025 um 18:28 schrieb wij:

    My primary interest of programming is on the theory. ...

    Then don't talk about practical issues.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Mon Jun 9 06:07:13 2025
    Am 08.06.2025 um 18:55 schrieb Scott Lurndal:

    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.

    Exceptions aren't for the regular case but for exceptions. I.e. if you
    have an I/O error or there's not enough memory. The time to handle this
    cases doesn't matter.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Mon Jun 9 06:09:07 2025
    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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From wij@3:633/280.2 to All on Mon Jun 9 08:51:32 2025
    On Sun, 2025-06-08 at 22:05 +0200, Bonita Montero wrote:
    Am 08.06.2025 um 18:28 schrieb wij:
    =20
    My primary interest of programming is on the theory. ...
    =20
    Then don't talk about practical issues.

    Where did I talk about theory?
    It is you who talked like you want a theoretic proof.
    (I have no problem with that except I don't think you will understand).
    And now, you cut the context off to indicate I only interested in theory (i= magination).

    Your several posts indicate that your fact is actually propaganda and rejec=
    t other=20
    facts (practice).


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From wij@3:633/280.2 to All on Mon Jun 9 09:13:34 2025
    T24gU3VuLCAyMDI1LTA2LTA4IGF0IDE2OjU1ICswMDAwLCBTY290dCBMdXJuZGFsIHdyb3RlOgo+ IAo+IEZvciBleGFtcGxlOgo+IAo+IGNfZmlsZV9jYXJkX3VuaXQ6OmNfZmlsZV9jYXJkX3VuaXQo dWxvbmcgY2hhbm5lbCwgdWxvbmcgdW5pdCwgY29uc3QgY2hhciAqbmFtZSwKPiDCoMKgwqDCoMKg wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC oCBjX2xvZ2dlciAqbHAsIGNfY2FyZF9kbHAgKmRscCwgYm9vbCBwdW5jaCwKPiDCoMKgwqDCoMKg wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC oCBib29sIGhvbGxlcml0aCwgY29uc3QgY2hhciAqYmlucGF0aCkKPiDCoMKgwqAgOiBjX2NhcmRf dW5pdChjaGFubmVsLCB1bml0LCBscCwgZGxwLCBwdW5jaCkKPiB7Cj4gwqDCoMKgIGludCBmbGFn cyA9IHB1bmNoP09fUkRXUnxPX0FQUEVORDpPX1JET05MWTsKPiDCoMKgwqAgaW50IGRpYWc7Cj4g wqDCoMKgIHVpbnQ4IGhlYWRlcltDQVJEX1NJWkVfQ09MVU1OU107Cj4gCj4gwqDCoMKgIGZfZmls ZcKgwqDCoMKgwqDCoMKgID0gTlVMTDsKPiDCoMKgwqAgZl9pbnB1dGhvcHBlciA9IDB1bDsKPiDC oMKgwqAgZl9iaW5mZMKgwqDCoMKgwqDCoCA9IC0xOwo+IMKgwqDCoCBzbnByaW50ZihmX2JpbmFy eV9wYXRoLCBzaXplb2YoZl9iaW5hcnlfcGF0aCksICIlcyIsIGJpbnBhdGgpOwo+IAo+IMKgwqDC oCBkaWFnID0gc3RhdChuYW1lLCAmY3Vfc3RhdCk7Cj4gwqDCoMKgIGlmIChkaWFnID09IC0xKSB7 Cj4gwqDCoMKgwqDCoMKgwqAgaWYgKChlcnJubyA9PSBFTk9FTlQpICYmIHB1bmNoKSB7Cj4gwqDC oMKgwqDCoMKgwqDCoMKgwqDCoCBmbGFncyB8PSBPX0NSRUFUfE9fRVhDTDsKPiDCoMKgwqDCoMKg wqDCoCB9Cj4gwqDCoMKgIH0KPiAKPiDCoMKgwqAgY3VfZmQgPSBvcGVuKG5hbWUsIGZsYWdzLCAw NjAwKTsKPiDCoMKgwqAgaWYgKGN1X2ZkID09IC0xKSB7Cj4gwqDCoMKgwqDCoMKgwqAgZnByaW50 ZihzdGRvdXQsICIlNC40bHUvJTIuMmx1IFVuYWJsZSB0byBvcGVuICclcyc6ICVzXG4iLAo+IMKg wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBjdV9jaGFubmVsLCBjdV91bml0LCBuYW1lLCBz dHJlcnJvcihlcnJubykpOwo+IMKgwqDCoMKgwqDCoMKgIHJldHVybjsKPiDCoMKgwqAgfQo+IAo+ IMKgwqDCoCBkaWFnID0gZmNudGwoY3VfZmQsIEZfU0VURkQsIEZEX0NMT0VYRUMpOwo+IMKgwqDC oCBpZiAoZGlhZyA9PSAtMSkgewo+IMKgwqDCoMKgwqDCoMKgIGxwLT5sb2coIiU0LjRsdS8lMi4y bHUgVW5hYmxlIHRvIHNldCBGRF9DTE9FWEVDIG9uICclcyc6ICVzXG4iLAo+IMKgwqDCoMKgwqDC oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBjdV9jaGFubmVsLCBjdV91bml0LCBuYW1l LCBzdHJlcnJvcihlcnJubykpOwo+IMKgwqDCoMKgwqDCoMKgIGRpYWcgPSBjbG9zZShjdV9mZCk7 Cj4gwqDCoMKgwqDCoMKgwqAgY3VfZmQgPSAtMTsKPiDCoMKgwqDCoMKgwqDCoCByZXR1cm47Cj4g wqDCoMKgIH0KPiAKPiAuLi4KPiB9CgpJIHdvdWxkIGxpa2UganVzdCBzaGFyZSBteSBjb21tZW50 IG9mIHRoZSBjb2RlIChqdXN0IHNraW0gdGhlIGNvZGUpLgogIApBc3N1bWUgY19maWxlX2NhcmRf dW5pdCguLikgaXMgYSBub3JtYWwgZnVuY3Rpb246IAoxLiBJdCBzaG91bGQgYmUgb2J2aW91cyB0 aHJvd2luZyBpcyBubyBnb29kIHRoYW4gcmV0dXJuaW5nIGVycm9yLgoyLiBFcnJvciBpcyBpc3N1 ZWQgaW4gc2V2ZXJsIHBsYWNlcywgcG9zdCBjb25kaXRpb24gaXMgYSBjb25jZXJuLgozLiBFcnJv ciBoYW5kbGluZyBpdHNlbGYgKGNvZGUgYW5kIHByb3BhZ2F0aW9uKSBoYXMgdG8gKG9yIGJldHRl ciBiZSkgZXJyb3IgZnJlZS4KNC4gQ2FuY2VsbGF0aW9uIHBvaW50L0FzeW5jLXNpZ25hbCBzYWZl IGlzc3Vlcy4gCgo+IGJvb2wKPiBjX2ZpbGVfY2FyZF91bml0Ojppc19yZWFkeSh2b2lkKQo+IHsK PiDCoMKgwqAgcmV0dXJuIChjdV9mZCAhPSAtMSkgJiYgKChmX2ZpbGUgIT0gTlVMTCkgJiYgIWZl b2YoZl9maWxlKSk7Cj4gfQo+IAo+IFNvLCBpZiBpc19yZWFkeSgpIHJldHVybnMgZmFsc2UgYWZ0 ZXIgdGhlIGNvbnN0cnVjdG9yIHJ1bnMsCj4gdGhlIGNyZWF0b3Igb2YgdGhlIG9iamVjdCBrbm93 cyB0aGUgY3JlYXRpb24gZmFpbGVkLgoKSWYgdGhlIGNvZGUgaW4gQysrIGNvbnN0cnVjdG9yLCBy ZXR1cm5pbmcgZXJyb3IgZW5jb3VudGVyZWQgaXMgbm8gZ29vZCwgJ2NvbnRyYWN0JyBpcyBicm9r ZW4uCkEgY3RvciBsaWtlIHRoaXMgc2hvdWxkIGJlIGNvbnNpZGVyZWQgdG9vIGNvbXBsaWNhdGVk IGJ1dCBmaW5lIGluIG5vbi1zZXJpb3VzIGNvZGUuCg==



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Mon Jun 9 17: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>

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Muttley@DastardlyHQ.org@3:633/280.2 to All on Mon Jun 9 19: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Muttley@DastardlyHQ.org@3:633/280.2 to All on Mon Jun 9 20: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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Mon Jun 9 20:58:07 2025
    Am 09.06.2025 um 11:20 schrieb Muttley@DastardlyHQ.org:

    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.
    I ask myself if setjmp() / longjmp() with manual unwinding then is
    cheaper than to just have error-returns.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Mon Jun 9 21:01:37 2025
    Am 09.06.2025 um 12:21 schrieb Muttley@DastardlyHQ.org:

    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.

    In Java they're also used for things that are more likely. But although
    Java is significantly slower than C++, exceptions are a magnitude faster
    than in C++.
    That's while with current table-driven exception handling does need to
    find the handler for the callers return address. As shared libraries
    might be loaded and unloaded asynchronously you've to ask the kernel
    for the image of every return address, and that's slow.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Mon Jun 9 21:04:45 2025
    Am 09.06.2025 um 09:59 schrieb Lawrence D'Oliveiro:

    Not necessarily that simple. It might be easier if C++ had
    try/finally (like Python does), but it doesn’t.

    The initial thought with C++ exceptions is that all the unrolling
    happens with RAII-classe so that you don't need finally. But some-
    times you won't write a class for each resource you hold. For this
    cases a helper-class like experimental::scope_exit is very comfor-
    table. Unfortunately that's still not in the standard so that I
    had to write it on my own:

    #pragma once
    #include <utility>
    #include <concepts>
    #include "nui.h"

    template<std::invocable Fn>
    struct defer final
    {
    defer( Fn &&fn ) :
    m_enabled( true ),
    m_fn( std::forward<Fn>( fn ) )
    {
    }
    defer( defer const & ) = delete;
    void operator =( defer const & ) = delete;
    ~defer()
    {
    if( m_enabled ) [[likely]]
    m_fn();
    }
    void operator ()()
    {
    if( !m_enabled ) [[unlikely]]
    return;
    m_fn();
    m_enabled = false;
    }
    void disable()
    {
    m_enabled = false;
    }
    private:
    bool m_enabled;
    NO_UNIQUE_ADDRESS Fn m_fn;
    };

    template<std::invocable ... Fns>
    inline void disable( defer<Fns> &... defs )
    {
    (defs.disable(), ...);
    }

    template<std::invocable Fn, std::invocable FnNext = Fn>
    struct xdefer final
    {
    xdefer( Fn &&fn, xdefer<FnNext> *next = nullptr ) :
    m_enabled( true ),
    m_next( next ),
    m_fn( std::forward<Fn>( fn ) )
    {
    }
    xdefer( xdefer const & ) = delete;
    void operator =( xdefer const & ) = delete;
    ~xdefer()
    {
    bool enabled = m_enabled;
    if( m_next ) [[likely]]
    m_next->m_enabled = enabled;
    if( enabled ) [[likely]]
    m_fn();
    }
    void operator ()()
    {
    if( !m_enabled ) [[unlikely]]
    return;
    m_fn();
    m_enabled = false;
    if( !m_next ) [[unlikely]]
    return;
    m_next->m_enabled = true;
    (*m_next)();
    }
    void disable()
    {
    m_enabled = false;
    }
    private:
    template<std::invocable Fn1, std::invocable Fn2>
    friend struct xdefer;
    bool m_enabled;
    xdefer<FnNext> *m_next;
    NO_UNIQUE_ADDRESS Fn m_fn;
    };

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Tue Jun 10 00:01:25 2025
    Reply-To: slp53@pacbell.net

    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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Tue Jun 10 01:24:28 2025
    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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Tue Jun 10 01:53:19 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Tue Jun 10 03:45:32 2025
    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.



    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Richard Heathfield@3:633/280.2 to All on Tue Jun 10 04: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


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: Fix this later (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Tue Jun 10 04:33:38 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Tue Jun 10 04:39:17 2025
    Am 09.06.2025 um 20:33 schrieb Scott Lurndal:

    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.

    These ways are all less comfortable than bad_alloc.

    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.

    With modern allocators like mimalloc allocation is that fast that
    you mostly can't compete with your own pools.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Tue Jun 10 11: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?

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Muttley@DastardlyHQ.org@3:633/280.2 to All on Tue Jun 10 17: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Tue Jun 10 17:51:12 2025
    Am 10.06.2025 um 03:59 schrieb Tim Rentsch:

    You're talking to someone who can't understand the difference
    between comp.lang.c and comp.lang.c++. What do you expect?

    Comparisons between C and any other lanugage are on-topic here. ;-)

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Tue Jun 10 20: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Tue Jun 10 22:07:40 2025
    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. The file might have been
    changed or deleted as you process a directory entry. Unfortunately there
    are no really transactional filesystems, although they would be only
    a bit slower.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Tue Jun 10 23:19:24 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Wed Jun 11 00: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Wed Jun 11 00:36:04 2025
    Reply-To: slp53@pacbell.net

    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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Wed Jun 11 00:40:28 2025
    Am 10.06.2025 um 16:36 schrieb Scott Lurndal:

    That's unavoidable with directory-operations.

    Incorrect. The entire purpose of the POSIX *at functions are to close
    those security holes.

    You confirm me and say I'm incorrect incorrect - in the same sentence ?


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Muttley@DastardlyHQ.org@3:633/280.2 to All on Wed Jun 11 00: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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Wed Jun 11 01: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Wed Jun 11 02: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Chris M. Thomasson@3:633/280.2 to All on Wed Jun 11 05:08:40 2025
    On 6/10/2025 6:19 AM, Scott Lurndal wrote:
    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.

    Humm... However, one can choose to carve out allocations from the
    region? Actually, this basically reminds me of my older region allocator
    code. So, this is basically dynamic within our defined region, so to
    speak. However, back in the day, I would try to recover from dynamic
    malloc failures... Just for testing the robustness of my system. Fwiw,
    here is my old region code:

    https://groups.google.com/g/comp.lang.c/c/7oaJFWKVCTw/m/sSWYU9BUS_QJ

    If it fails to allocate, it simply means the region is exhausted at that
    time. Then my code can fall back to dumping connections, freeing cache,
    and try the allocation again? Fair enough? It was a long time ago, and
    when I was conducting said experiments. Fwiw, here is a direct link to
    my old region code that is, well, fun to me at least... :^)

    https://pastebin.com/raw/f37a23918

    Does it still work for anybody? ;^o

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Waldek Hebisch@3:633/280.2 to All on Wed Jun 11 06: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: To protect and to server (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Wed Jun 11 06:35:19 2025
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
    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.

    And the point of my comment was 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.

    That doesn't strike me as better. You're suggesting a substantial reorganization to avoid some simple name conflicts (identifiers
    starting with 'E'). I find it much easier -- and yes, better --
    to avoid defining identifiers starting with 'E'. (Actually only
    identifiers starting with 'E' followed by either a digit or an
    uppercase letter are reserved. It's simpler to avoid all identifiers
    starting with 'E', but you can safely use something like "Escape"
    if you like.)

    If there are other reasons for such an organization, that's fine.

    (My personal policy is to assume a more expansive set of reserved
    identifiers, because it means I only have to remember a simpler
    set of rules. For example, I find it easier to avoid defining any
    identifiers starting with '_' than to account for the rules for which
    _* identifiers are reserved for which purposes in which contexts.
    Of course I'll look up and apply the actual rules when I need to.)

    I find the reservation of potential errno macro names annoying.
    Using and reserving identifiers starting with "E_", for example,
    would have been less intrusive. But we're stuck with it.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Wed Jun 11 07: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Wed Jun 11 08:09:44 2025
    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.

    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().

    Nothing can prevent all possible name clashes, but I like to follow the
    rules in the standard that let me prevent some of them.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Wed Jun 11 09: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Wed Jun 11 11: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Keith Thompson@3:633/280.2 to All on Wed Jun 11 12:11:09 2025
    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?

    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.

    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).

    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.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    void Void(void) { Void(); } /* The recursive call of the void */

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: None to speak of (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Wed Jun 11 15:07:37 2025
    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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Wed Jun 11 15: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Scott Lurndal@3:633/280.2 to All on Wed Jun 11 23:41:11 2025
    Reply-To: slp53@pacbell.net

    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.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: UsenetServer - www.usenetserver.com (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Thu Jun 12 01: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Kaz Kylheku@3:633/280.2 to All on Thu Jun 12 01: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

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Bonita Montero@3:633/280.2 to All on Thu Jun 12 01:33:21 2025
    Am 11.06.2025 um 15:41 schrieb Scott Lurndal:

    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.

    That doesn't make a difference for the discussed point.


    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Chris M. Thomasson@3:633/280.2 to All on Thu Jun 12 04:57:41 2025
    On 6/10/2025 3:09 PM, Keith Thompson 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.

    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().

    Nothing can prevent all possible name clashes, but I like to follow the
    rules in the standard that let me prevent some of them.


    Wrt to prepending to artificially create a namespace in C, ct, ala
    ct_*_*_* is fine with me. For your new addition how about a keith_thompson_*_*_* for your namespace? Or even a kt_* ? ;^)

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence D'Oliveiro@3:633/280.2 to All on Thu Jun 12 11: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Tim Rentsch@3:633/280.2 to All on Thu Jun 12 13: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.

    --- MBSE BBS v1.1.1 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)