News for hackers. Stuff that matters.
Re:Everybody makes mistakes when writing comparison functions by coldpie on Thursday September 09, 2021 @10:24AM (#28470009)
Having unused parameters is super common, especially when using function-pointer-based APIs like qsort. Arguably they should have annotated the arguments to suppress the warnings, but that starts to get into compiler compatibility (OpenSSL is used on a _lot_ of systems with a _lot_ of compilers) and becomes a much larger question than just setting -Wno-unused-parameter.
Re:Everybody makes mistakes when writing comparison functions by commandlinefan on Thursday September 09, 2021 @12:22PM (#28471412)
> especially when using function-pointer-based APIs like qsort

Well, the function should be called somewhere, even if it's ignored when null. I can't think of a legitimate case for an unused parameter - it might be #ifdef-ed out in some cases, but it should still be referenced somewhere.

Re:Everybody makes mistakes when writing comparison functions by coldpie on Thursday September 09, 2021 @01:32PM (#28472298)
For qsort, sure, but it's pretty common to not need the void* argument for the start_routine you pass to pthread_create, to come up with one example.