News for hackers. Stuff that matters.
Re:Results of the 2015 Underhanded C Contest by nkurz on Thursday February 04, 2016 @02:28PM (#11036493)
Thanks for mentioning that option. I hadn't known about it.

Clang does give a warning with -Weverything, but I don't understand what it means: http://goo.gl/M9qjmx

  13 : warning: no previous prototype for function spectral_contrast' [-Wmissing-prototypes]
       double spectral_contrast(float_t *a, float_t *b, int length) {
It gives the same warning if I change all the float_t's to float, or if I change all the float_t's to double, so I think it's not actually useful or relevant.
Re:Results of the 2015 Underhanded C Contest by 3JPLW on Thursday February 04, 2016 @03:43PM (#11037058)
It's effectively catching the fact that `spectral_contrast.c` does not `#include "match.h"` — this is indeed directly a part of the underhandedness.

The warning occurs because the function is not static — and therefore callable by other modules. Since it's missing a forward definition (a previous prototype), those modules must blindly declare the prototypes themselves… and their prototypes can get out of sync with the actual definition. That's what's happening here. `match.h` has the forward prototype, but it's very subtly different from the definition. Were match.h included, there'd be a much more glaring warning (or maybe even error).