Problem with warning: gcrypt.h '...' is deprecated messages

Antonio Borneo borneo.antonio at gmail.com
Wed Sep 7 16:57:29 CEST 2011


On Tue, Sep 6, 2011 at 4:46 PM, Werner Koch <wk at gnupg.org> wrote:
> On Mon,  5 Sep 2011 08:26, borneo.antonio at gmail.com said:
>
>> Could you please provide me, as reference, the version of gcc you are using?
>
> gcc (Debian 4.6.1-1) 4.6.1
>
>> But if I define only GCRYPT_NO_DEPRECATED, I still get 6 warnings.
>
> I see.   The cause for this is that libgcrypt need the definition of
> theses structures for itself.  Thus a simple GCRYPT_NO_DEPRECATED is not
> sufficient here.  I should have put
>
> #if !defined(GCRYPT_NO_DEPRECATED) || defined(_GCRYPT_IN_LIBGCRYPT)
> /* Alternative interface for asymmetric cryptography.  This interface
>   is deprecated.  */
>
> /* The algorithm IDs. */
> typedef enum gcry_ac_id
> ....
> typedef struct gcry_ac_ssa_pkcs_v1_5
> {
>  gcry_md_algo_t md;
> } gcry_ac_ssa_pkcs_v1_5_t _GCRY_ATTR_INTERNAL;
>
> #endif
>
> around the gcry_ac structure definitions.

Perfect!
Confirm that with such modification I can compile with gcc 4.4.5
- the empty example code I proposed before with -DGCRYPT_NO_DEPRECATED
- the whole libgcrypt 1.5.0
- the code in the project "vpnc", again defining GCRYPT_NO_DEPRECATED

Thanks and Best Regards
Antonio Borneo



More information about the Gcrypt-devel mailing list