xdg-desktop-portal-gtk icon indicating copy to clipboard operation
xdg-desktop-portal-gtk copied to clipboard

Improve compile warnings

Open ebassi opened this issue 2 years ago • 4 comments
trafficstars

If we can, we should rejig the code to avoid declaring unused arguments and variables; if we can't, we can use G_GNUC_UNUSED to eliminate the warning.

ebassi avatar Oct 21 '23 15:10 ebassi

Actually, the compiler warnings situation is not nice. We're currently using warning_level=2 but:

  • we should really use warning_level=3
  • we should add more warnings to the Meson baseline

xdg-desktop-portal-gtk is a security boundary, and we should be more careful with the code we're shipping.

ebassi avatar Oct 21 '23 15:10 ebassi

We're currently using warning_level=2 but we should really use warning_level=3

My personal opinion is -pedantic contains a lot of pointless annoyances and just including specific warnings has better results.

TingPing avatar Oct 21 '23 17:10 TingPing

I agree about pedantic, so even with warning_level=3 I'd drop it with additional compiler warnings; the other option is to add a bunch of warnings ourselves on top of warning_level=2.

ebassi avatar Oct 21 '23 17:10 ebassi

Just to clarify, warning_level=3 only adds -Wpedantic:

https://github.com/mesonbuild/meson/blob/ae7a9b0f4430a055ac419c6f1157cbd0e6eed45c/mesonbuild/compilers/c.py#L155-L158

TingPing avatar Oct 21 '23 17:10 TingPing