News for hackers. Stuff that matters.
Re:On leading underscores and names reserved by the C and C+... by ameliaquining on Wednesday January 11, 2023 @11:02AM (#34339908)
That's POSIX, not the C language standard. https://www.iso-9899.info/n1570.html#7.31 lists the library API names reserved for future use; section 7.1.3 in the same document states explicitly that they are reserved.

It's not that the word "island" has any particular significance; it's that all names starting with "is" followed by a lowercase letter are reserved (in external linkage and in the global scope of files that #include <ctype.h>), so that future versions of the language can add more standard library functions along the lines of isalpha, isdigit, etc., without making the current standards committee guess in advance which specific names following that pattern their successors might want to add in the future, and without breaking existing code. (Unless that existing code ignores these rules, which seems to be fairly common in practice.)

Re:On leading underscores and names reserved by the C and C+... by SAI_Peregrinus on Wednesday January 11, 2023 @11:10AM (#34339998)
The C is of course a pirate's favorite language. It might end up with "water" and "land" types in the standard some day. So `bool iswater()` and `bool island()` functions might be needed! You might need to check if the island structure you got is really land, so `island(&possible_island)` would obviously help and not cause any confusion to readers of the code.
Re:On leading underscores and names reserved by the C and C+... by sokoloff on Wednesday January 11, 2023 @07:27PM (#34347268)
You might want to know if you have a small piece of land surrounded by water, so we need

  isisland(x);
Or to know if an element is a member of a particular terror group (or an Egyptian goddess):

  isisis(y);
Re:On leading underscores and names reserved by the C and C+... by cozzyd on Wednesday January 11, 2023 @11:42PM (#34349306)
And if you want to know if some territory is claimed by a particular terror group (or Egyptian goddess, or post-metal band) there is the venerable

  isisisland(z);
In this case you'd typically then construct a memory fence.
Re:On leading underscores and names reserved by the C and C+... by ketralnis on Wednesday January 11, 2023 @07:53PM (#34347546)
Aye, any pirate's first love be the C
Re:On leading underscores and names reserved by the C and C+... by cozzyd on Wednesday January 11, 2023 @11:39PM (#34349283)
You just have to pass the pirate flag to your compiler
Re:On leading underscores and names reserved by the C and C+... by 0xADD1E on Friday January 13, 2023 @05:47AM (#34366129)
I think you’ll find it’s actually called an arrgument
Re:On leading underscores and names reserved by the C and C+... by Gibbon1 on Friday January 13, 2023 @12:04AM (#34364156)
Of course depending on how locale is set will effect the results of island() and iswater()
Re:On leading underscores and names reserved by the C and C+... by xigoi on Wednesday January 11, 2023 @12:32PM (#34341335)
They could just generate a random string, making it extremely unlikely that it will conflict with an existing name. And it won't be any less descriptive than most existing names in the C standard library.
Re:On leading underscores and names reserved by the C and C+... by pcwalton on Wednesday January 11, 2023 @02:02PM (#34342885)
I saw someone point out that these identifier restrictions mean that a valid C compiler optimization would be to change all instances of "x = to[a-z]+(y);" to "if (!is[a-z]+(y)) x = to[a-z]+(y);" Not that any compiler would actually be absurd enough to implement this, of course :)

Naturally, this would imply the validity of the optimization:

x = toilet(y); -> if (!isilet(y)) x = toilet(y);

Re:On leading underscores and names reserved by the C and C+... by caf on Wednesday January 11, 2023 @08:40PM (#34347934)
Only if you've included <ctype.h> or <wctype.h> though.