Hi Michael, > Date: 2026-10-24 09:45:02-0300 > From: "Michael Kerrisk (man7.org)" > > Hello Christopher > [...] > > I am curious to know what your attitude would be to lesser-known > > standard C syntax. > > > > For example: > > > > int pipe(int pipefd[static 2]);comprehensible > > > > is standard C syntax, and requires the caller to pass a pointer to the > > first of at least 2 array elements, unlike > > > > int pipe(int pipefd[2]); > > > > which has the same semantics in ISO C as > > > > int pipe(int *pipefd); > > I was unfamiliar with that syntax, but at least in context it is > immediately understandable, Actually, it is not understandable. [static 2] doesn't mean the same as [2], and this is one historic mistake of the C Committee that I wish had never happened. [static 2] is never what you want (I was tempted to say almost never, but I've never seen a good case for it). Programmers want the meaning of [2]. The main differences between [static 2] and [2] are: - [2] means (in GNU C, and in common understanding, but not acknowledged by ISO C) that: - The caller must supply at least 2 elements. - The callee must not access past those 2 elements. - [static 2] means (in ISO C, but ignored by GCC): - The caller must supply at least 2 elements. - The callee is free to access past those 2 elements!! (of course, if there aren't any elements after that, it's UB) - The caller must supply a non-null pointer. The null-pointer issue is nonsense, but we can live with it. The allowance to access past the specified length, that's the real issue with this feature, and why it should not be used at all. The committee was clearly confused when they added this feature. It was around the time when 'restrict' was added, which is another historical mistake of the committee. In general, every feature they added thinking of optimizations (and that includes these two) has resulted in a mistake. > and I so I don't dislike it, And it is > standard C. When the standard clashes with reality and common sense, I'm not sure I'd give the standard much credibility. > I really don't think Linux man-pages is the place to > introducing nonstandard, GNU-specific syntax (that people clearly > don't understand). People clearly don't understand [static 2] either. Have a lovely day! Alex --