4 ms·
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/M
by nkurz 11y ago
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 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.
- 3JPLW 11y agoIt'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).