On 24/07/2020 18.49, Daniel P. Berrangé wrote: > On Fri, Jul 24, 2020 at 06:46:23PM +0200, Philippe Mathieu-Daudé wrote: >> On 7/24/20 4:46 PM, Daniel P. Berrangé wrote: >>> On Fri, Jul 24, 2020 at 04:32:19PM +0200, Thomas Huth wrote: >>>> Compiler warnings currently go unnoticed in our FreeBSD and macOS builds, >>>> since -Werror is only enabled for Linux and MinGW builds by default. So >>>> let's enable them here now, too. >>>> For macOS, that unfortunately means that we have to disable the vnc-sasl >>>> feature, since this is marked as deprecated in the macOS headers and thus >>>> generates a lot of deprecation warnings. >>> >>> I wonder if its possible to add >>> >>> #pragma GCC diagnostic push >>> #pragma GCC diagnostic ignored "-Wdeprecated" >>> >>> ... >>> >>> #pragma GCC diagnostic pop >>> >>> to silence just one source file ? >> >> 3 years ago Peter said: >> >> "The awkward part is >> that it has to be in force at the point where the deprecated >> function is used, not where it's declared. So you can't just wrap >> the #include of the ssl header in pragmas, you'd have to either >> do it at every callsite or else over the whole .c file." > > Nearly all our sasl code is isolated in ui/vnc-auth-sasl.c, so we > can just do pragma push/pop around that entire file. > > There's then just two remaining cases in ui/vnc.c which are > easy enough to deal with, or we can move the calls out of vnc.c > into vnc-auth-sasl.c to fully isolate the code
Sounds like it could be done, indeed. But I wonder whether we really really want to silence the warnings here? We'd hide the information to the users that sasl is apparently disliked by Apple and might get removed on macOS in the future. Maybe we should rather change the "configure" script to disable sasl by default on macOS unless the user explicitely specified --enable-vnc-sasl ? Thomas