News for hackers. Stuff that matters.
Re:Show HN: A pure C89 implementation of Go channels, with b... by kazinator on Wednesday December 13, 2023 @04:31PM (#38634413)
> The return type of comparison operators is entirely irrelevant

It is entirely relevant. The boolean type of the language is whatever is the type of (0 < 1).

> Typedefs have their own namespace anyway

Typedefs positively do not have their own namespace.

If you write

  #undef getc
  {
     typedef char getc;

  }
you cannot call the getc function in that scope; it is now the typedef.
Re:Show HN: A pure C89 implementation of Go channels, with b... by codys on Wednesday December 13, 2023 @08:13PM (#38636578)
When folks talk about namespaces, structs, & typedefs in C, it's to call out that `struct X` and `typedef int X;` can both exist at the same time. In other words, nothing prevents one from doing a `typedef struct X { int f; } X;` or similar, using `X` as the name in both places.

It is true that it's more correct to say "struct names have their own namespace", though I think we can infer what's actually meant here fairly easily.

Re:Show HN: A pure C89 implementation of Go channels, with b... by kazinator on Wednesday December 13, 2023 @08:41PM (#38636775)
> more correct to say "struct names have their own namespace"

That is false. If we declare an "enum foo", which is not a struct, then we cannot have a "struct foo" in that scope.

Re:Show HN: A pure C89 implementation of Go channels, with b... by codys on Wednesday December 13, 2023 @09:02PM (#38636913)
Sure, you're right, it's just not really relevant here.
Re:Show HN: A pure C89 implementation of Go channels, with b... by kazinator on Wednesday December 13, 2023 @09:12PM (#38636984)
Well, your two comments set a standard for relevance that is not easily attained by others.