python: Silence a few warnings.

* src/gpgme.h.in: Obsolete "class" also for Python.
* lang/python/gpgme.i: Silenece a swig warning.  Silence a gcc
warning.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2018-09-20 17:28:25 +02:00
parent ec2d2b78bc
commit dcdabf5f2e
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 16 additions and 3 deletions

View File

@ -21,6 +21,12 @@
%include "cpointer.i"
%include "cstring.i"
%{
/* We use public symbols (eg. "_obsolete_class") which are marked as
* deprecated but we need to keep them. Silence the warning. */
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
%}
/* Generate doc strings for all methods.
This will generate docstrings of the form
@ -575,7 +581,8 @@ off_t gpgme_data_seek (gpgme_data_t dh, off_t offset, int whence=SEEK_SET);
%}
/* This is for notations, where we want to hide the length fields, and
the unused bit field block. */
* the unused bit field block. We silence the warning. */
%warnfilter(302) _gpgme_sig_notation;
struct _gpgme_sig_notation
{
struct _gpgme_sig_notation *next;

View File

@ -95,6 +95,12 @@ extern "C" {
#define _GPGME_DEPRECATED_OUTSIDE_GPGME(a,b) _GPGME_DEPRECATED(a,b)
#endif
/* We used to use some symbols which clash with keywords in some
* languages. This macro is used to obsolete them. */
#if defined(__cplusplus) || defined(SWIGPYTHON)
# define _GPGME_OBSOLETE_SOME_SYMBOLS 1
#endif
/* Check for a matching _FILE_OFFSET_BITS definition. */
#if @NEED__FILE_OFFSET_BITS@
@ -640,7 +646,7 @@ struct _gpgme_key_sig
gpgme_error_t status;
/* Deprecated; use SIG_CLASS instead. */
#ifdef __cplusplus
#ifdef _GPGME_OBSOLETE_SOME_SYMBOLS
unsigned int _obsolete_class _GPGME_DEPRECATED(0,4);
#else
unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME(0,4);
@ -1466,7 +1472,7 @@ struct _gpgme_new_signature
char *fpr;
/* Deprecated; use SIG_CLASS instead. */
#ifdef __cplusplus
#ifdef _GPGME_OBSOLETE_SOME_SYMBOLS
unsigned int _obsolete_class_2;
#else
unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME(0,4);