[libdvdnav-devel] [RFC PATCH 0/2] Annotate unused function parameters

Andrew Clayton andrew at digital-domain.net
Tue Nov 4 02:08:30 CET 2014


Some functions in libdvdread take parameters that are unused, e.g
file_read() in dvd_input.c. These functions can't be changed to remove
the unused parameters as they are public API.

This patch set adds a check to configure.ac for GCC, if found it creates
a #define UNUSED set to __attribute__((unused)) (empty otherwise) this
can be used to inform the compiler about unused function parameters to
get rid of the compiler warnings about such.

This could also be done a bit more blunt forcibly with the
-Wno-unused-parameter compiler option, but it's perhaps a generally useful
thing to have enabled.

Andrew Clayton (2):
  configure.ac: Create an UNUSED #define for parameter passing
  src/dvd_input.c: Annotate unused function parameters

 configure.ac    | 6 ++++++
 src/dvd_input.c | 7 ++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

-- 
1.9.3



More information about the libdvdnav-devel mailing list