News for hackers. Stuff that matters.
Re:The MIN Challenge by iano on Sunday June 15, 2014 @06:00PM (#7896485)
Not entirely related to the post, but what's the sane use case for doing:

  return (expr, expr)
like in the first example? I cannot think of a good reason to do this.
Re:The MIN Challenge by tkmcc on Sunday June 15, 2014 @06:34PM (#7896575)
It may not be a good reason to do this, but you can condense

    if (failure) {
        errno = EINVAL;
        return -1;
    }
into

    if (failure)
        return (errno = EINVAL, -1);
Re:The MIN Challenge by jabagawee on Sunday June 15, 2014 @08:57PM (#7896917)
In any sane code, you'd have the open and close brackets anyways, so all this code does is trade a few '\n' characters for a few parentheses characters. I'd opt for the former still.
Re:The MIN Challenge by eatnumber1 on Sunday June 15, 2014 @06:15PM (#7896521)
If the min macro would have worked, it would have allowed the two lines

    min(1, 2, out);
    return out;
to be condensed into one line.
Re:The MIN Challenge by kzrdude on Sunday June 15, 2014 @06:07PM (#7896506)
I know this mainly as a useful macro implementation trick if where you want to be able to use it in an expression.
Re:The MIN Challenge by octo_t on Sunday June 15, 2014 @06:05PM (#7896497)
It simplifies the grammar, immensely.