Wireshark-dev: [Wireshark-dev] libgcrypt 1.5.0 compiler warnings
From: Martin Kaiser <lists@xxxxxxxxx>
Date: Thu, 21 Feb 2013 09:47:08 +0100
Dear all,

this issue has been around for a long time. When we use libgcrypt 1.5.0,
including gcrypt.h spills out lots of warnings about deprecated
definitions, breaking compilation with -Werror.

Steven Fisher asked about this on the libgcrypt list

http://old.nabble.com/Re%3A-Problem-with-warning%3A-gcrypt.h-%27...%27-is-deprecated-messages-p32398900.html

It was said that it's a gcc specific problem.

I was wondering if we could use gcc pragmas to address this. How about
replacing

#include <gcrypt.h>

with

#pragma GCC diagnostic push
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
#include <gcrypt.h>
#pragma GCC diagnostic pop


This should be enough as we don't seem to use any of the deprecated
functionality.

It's relatively few places where gcrypt.h is included.

If that's too error-prone as people may include gcrypt.h elsewhere in
the future and forget to add the pragmas, we could have a wrapper
include file (epan/crypt/ws-libgcrypt.h ?) with the 4 lines above and
include that instead of gcrypt.h.

Thoughts?

Best regards,

   Martin