-
A few questions
1. The standard allows multibyte character sets. What character set is most commonly used with C? Is it UTF-8?
2. Does anyone actually use trigraphs these days? Or does that only apply to obscure, old machines?
3. The functions in the standard library are not re-entrant. Yet, my program might access the library at the same time as another process on the same machine. Does the library have separate static storage *for each thread* ?
-
1. The standard allows multibyte character sets. What character set is most commonly used with C? Is it UTF-8?
C is on so many different kinds of platforms, it's hard to say what would be "common".
You might get a useful answer if you restrict yourself to say "Linux console" programming or "Win32 GUI" programming.
2. Does anyone actually use trigraphs these days? Or does that only apply to obscure, old machines?
Digraphs and trigraphs - Wikipedia, the free encyclopedia
3. The functions in the standard library are not re-entrant. Yet, my program might access the library at the same time as another process on the same machine.
Does the library have separate static storage *for each thread* ?
This is a feature of your OS, providing separate address spaces to each process.
But since you said threads, which share the same address space, then you would need to be mindful of concurrency issues.
And it's only some of the functions which are non-reentrant, not all of them.
-
Digraphs and trigraphs are sometimes used by some programmers who are not native english speakers, and who use keyboards that do not support all characters in C's basic character set.
Other than that, the only places where I've seen digraphs and trigraphs deliberately used is in compiler stress tests or benchmarks. I've seen them used accidentally quite a few times though.
-
A function like strtok is not re-entrant, but then the standard library doesn't include threads. If something like pthreads is used then posix includes a matching strtok_r that is re-entrant. Don't know about C11, which do add threading to the standard library.