News for hackers. Stuff that matters.
Re:Gosh Darn Function Pointers by inopinatus on Monday January 15, 2018 @04:53PM (#16153777)
Simply declaring a function gives you a pointer to that function. Which reminds me of the time I wrote this in a PR to FreeBSD:

    if ((Lflag ? chown : lchown)(p->fts_accpath, -1, s->st_gid))
      /* .. */
a line that turned out to be incredibly polarising amongst code reviewers.

Explanation for those not well versed in C: the ternary in the left-hand parentheses is selecting which syscall wrapper function will be dereferenced and called with the arguments in the right-hand parentheses. It relies on the chown(2) and lchown(2) syscall wrappers having identical function signatures.

Re:Gosh Darn Function Pointers by edcarter on Monday January 15, 2018 @05:34PM (#16154068)
That is fancy, but not very readable. I would have been on the side of the code review which would favor readability over conciseness. Cool trick though.