News for hackers. Stuff that matters.
Re:Building a C Compiler Type System – Part 1: The Formidabl... by Gankro on Thursday July 07, 2016 @03:14PM (#12051502)
I don't see how anything they said is incorrect. The type is int*, the name is p. C just has this weirdly optimized multiple value decl syntax that for some reason really wants to make it easy to declare an array of int, pointer to int, and function to int all at once instead of making it easy to declare multiple pointers to int.

It seems to be a perfectly rational reaction to say "oh this was a stupid idea, let's not take advantage of it". (which is honestly a great way to approach a lot of C's features)

Re:Building a C Compiler Type System – Part 1: The Formidabl... by ScottBurson on Thursday July 07, 2016 @06:05PM (#12052372)
I don't really disagree; just remember that you're abusing the syntax, because if you forget, it will abuse you back.
Re:Building a C Compiler Type System – Part 1: The Formidabl... by jotux on Thursday July 07, 2016 @03:20PM (#12051529)
C's comma operator syntax is also weird and, in my experience, many people don't really understand it that well.

edit: In reference to the last line: "oh this was a stupid idea, let's not take advantage of it".

It's a weird feature that generally makes the code more difficult to understand but people still use it a lot, similar to multiple declarations on a single line with pointers mixed in.

Re:Building a C Compiler Type System – Part 1: The Formidabl... by bluetomcat on Thursday July 07, 2016 @03:53PM (#12051689)
The comma acts as a separator in declarations, function calls and initializers.

In ordinary expressions it is a normal binary operator (just like / or &&), but has the lowest precedence and simply evaluates the left-hand side, discarding the result, then (in that order) evaluates the right-hand side, returning its value as the result.

Re:Building a C Compiler Type System – Part 1: The Formidabl... by penguinduck on Thursday July 07, 2016 @03:45PM (#12051652)
Maybe you don't understand it that well because the described usage of a comma is not a comma operator (or any kind of operator).
Re:Building a C Compiler Type System – Part 1: The Formidabl... by imtringued on Friday July 08, 2016 @01:26AM (#12053686)
Re:Building a C Compiler Type System – Part 1: The Formidabl... by penguinduck on Friday July 08, 2016 @01:54AM (#12053778)
Your point? The multiple declaration syntax which is being discussed here uses comma separators, not operators.