Hacker News new | past | comments | ask | show | jobs | submit login

That's mostly a cosmetic warning. If you add a prototype for NeverCalled() at the top of the file, it silences the warning, but Clang still emits the same code.



> If you add a prototype for NeverCalled() at the top of the file, it silences the warning

Or you could write correct C and use (void) instead of () as argument list.


This example is C++, not C. Clang is complaining because it's good practice to declare a prototype for a non-static function (in a header file) before using or declaring the function itself, so it can't accidentally be used with the wrong parameter list in a different compilation unit. It will produce this warning if you have () or (void) as the parameter list.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: