cdparanoia: Ignore compiler warning coming from the cdparanoia header
authorJordan Petridis <jordan@centricular.com>
Wed, 6 Jul 2022 18:45:24 +0000 (21:45 +0300)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 19 Oct 2022 08:18:45 +0000 (08:18 +0000)
When trying to build the plugin, GCC starts complaining about issues
with one of the cdparanoia headers and it block us from being able
to build the plugin with Werror.

The current warning in the header look like this:

```
[1/2] Compiling C object subprojects/gst-plugins-base/ext/cdparanoia/libgstcdparanoia.so.p/gstcdparanoiasrc.c.o
In file included from ../subprojects/gst-plugins-base/ext/cdparanoia/gstcdparanoiasrc.h:37,
                 from ../subprojects/gst-plugins-base/ext/cdparanoia/gstcdparanoiasrc.c:31:
/usr/include/cdda/cdda_interface.h:164:3: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  164 |   "Success",
      |   ^~~~~~~~~
...
/usr/include/cdda/cdda_interface.h:163:14: warning: ‘strerror_tr’ defined but not used [-Wunused-variable]
  163 | static char *strerror_tr[]={
      |              ^~~~~~~~~~~
[2/2] Linking target subprojects/gst-plugins-base/ext/cdparanoia/libgstcdparanoia.so
```

Last release of cdparanoia was in 2008, so our best bet for the
time is to ignore the warnings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2722>

subprojects/gst-plugins-base/ext/cdparanoia/meson.build

index 66ca358..3a56340 100644 (file)
@@ -29,10 +29,19 @@ if not cdparanoia_found and cdparanoia_option.enabled()
 endif
 
 if cdparanoia_found
+  # The cdda/cdda_interface.h header triggers GCC 12+ warnings which
+  # then trickle down when we build the plugin with -Werror.
+  # This wouldn't be needed usually, but cdparanoia's last release
+  # was in 2008.
+  extra_args = cc.get_supported_arguments([
+      '-Wno-discarded-qualifiers',
+      '-Wno-unused-variable'
+  ])
+
   gstcdparanoia = library('gstcdparanoia',
     ['gstcdparanoiasrc.c'],
     include_directories: [configinc, libsinc],
-    c_args : gst_plugins_base_args,
+    c_args : gst_plugins_base_args + extra_args,
     dependencies : cdparanoia_deps + [audio_dep, gst_dep, gst_base_dep],
     install : true,
     install_dir : plugins_install_dir,