Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: gcrypt

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

 

 

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded


steve at stephen-fisher

Jul 13, 2011, 9:29 AM

Post #1 of 6 (1152 views)
Permalink
Problem with warning: gcrypt.h '...' is deprecated messages

Since upgrading to libgcrypt 1.5.0 recently, I'm having problems with
messages such as these...

/usr/local/include/gcrypt.h:1643: warning: 'gcry_ac_io_t' is deprecated
/usr/local/include/gcrypt.h:1649: warning: 'gcry_ac_id_t' is deprecated
/usr/local/include/gcrypt.h:1656: warning: 'gcry_ac_id_t' is deprecated

The release announcement for 1.5.0 says that using gcry_ac_ functions
will produce compile time warnings. We are not using those functions,
so the mere inclusion of the gcrypt.h header file is causing these
warnings because they are marked with the "_GCRY_ATTR_INTERNAL" macro,
which becomes the gcc deprecated attribute.

I found this problem with a project I'm a developer for called
Wireshark. We compile with -Werror in development versions, so these
warnings stop the compilation. Compiling a simple hello world program
with gcrypt.h included has the same problem. Defining "
_GCRYPT_IN_LIBGCRYPT" to "1" in Wireshark sources before the gcrypt.h
inclusion works around this problem in my local sources.

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel


wk at gnupg

Jul 14, 2011, 12:53 AM

Post #2 of 6 (1113 views)
Permalink
Re: Problem with warning: gcrypt.h '...' is deprecated messages [In reply to]

On Wed, 13 Jul 2011 18:29, steve [at] stephen-fisher said:

> /usr/local/include/gcrypt.h:1656: warning: 'gcry_ac_id_t' is deprecated
>
> The release announcement for 1.5.0 says that using gcry_ac_ functions
> will produce compile time warnings. We are not using those functions,

That is a bug in some versions of gcc.

> with gcrypt.h included has the same problem. Defining "
> _GCRYPT_IN_LIBGCRYPT" to "1" in Wireshark sources before the gcrypt.h
> inclusion works around this problem in my local sources.

Please don't do this.


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel


bradh at frogmouth

Jul 14, 2011, 1:54 AM

Post #3 of 6 (1112 views)
Permalink
Re: Problem with warning: gcrypt.h '...' is deprecated messages [In reply to]

On Thursday 14 July 2011 17:53:40 Werner Koch wrote:
> On Wed, 13 Jul 2011 18:29, steve [at] stephen-fisher said:
> > /usr/local/include/gcrypt.h:1656: warning: 'gcry_ac_id_t' is deprecated
> >
> > The release announcement for 1.5.0 says that using gcry_ac_ functions
> > will produce compile time warnings. We are not using those functions,
>
> That is a bug in some versions of gcc.
>
> > with gcrypt.h included has the same problem. Defining "
> > _GCRYPT_IN_LIBGCRYPT" to "1" in Wireshark sources before the gcrypt.h
> > inclusion works around this problem in my local sources.
>
> Please don't do this.
You can work around this problem using gcc pragmas.
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
before the include, and
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
after the include will probably do it.

Brad

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel


borneo.antonio at gmail

Sep 4, 2011, 11:26 PM

Post #4 of 6 (936 views)
Permalink
Re: Problem with warning: gcrypt.h '...' is deprecated messages [In reply to]

Hi Werner,


Werner Koch wrote:
>
> On Wed, 13 Jul 2011 18:29, steve [at] stephen-fisher said:
>
>> /usr/local/include/gcrypt.h:1656: warning: 'gcry_ac_id_t' is deprecated
>>
>> The release announcement for 1.5.0 says that using gcry_ac_ functions
>> will produce compile time warnings. We are not using those functions,
>
> That is a bug in some versions of gcc.
>
I have checked several version of gcc, but till now I cannot find a version
that does not complain.
Could you please provide me, as reference, the version of gcc you are using?



>> with gcrypt.h included has the same problem. Defining "
>> _GCRYPT_IN_LIBGCRYPT" to "1" in Wireshark sources before the gcrypt.h
>> inclusion works around this problem in my local sources.
>
> Please don't do this.
>
Agree!
But if I define only GCRYPT_NO_DEPRECATED, I still get 6 warnings.

Below my test. Same result with many gcc from 4.4.5 to 4.6.0:
$ echo '#include "libgcrypt-1.5.0/src/gcrypt.h"' > check-gcrypt.c
$ gcc -c check-gcrypt.c
get 83 warnings
$ gcc -D GCRYPT_NO_DEPRECATED -c check-gcrypt.c
In file included from check-gcrypt.c:2:
libgcrypt-1.5.0/src/gcrypt.h:1336: warning: ‘gcry_ac_io_mode_t’ is
deprecated
libgcrypt-1.5.0/src/gcrypt.h:1337: warning: ‘gcry_ac_io_type_t’ is
deprecated
libgcrypt-1.5.0/src/gcrypt.h:1344: warning: ‘gcry_ac_data_read_cb_t’ is
deprecated
libgcrypt-1.5.0/src/gcrypt.h:1358: warning: ‘gcry_ac_data_write_cb_t’ is
deprecated
libgcrypt-1.5.0/src/gcrypt.h:1393: warning: ‘gcry_md_algo_t’ is
deprecated
libgcrypt-1.5.0/src/gcrypt.h:1401: warning: ‘gcry_md_algo_t’ is
deprecated

Best Regards,
Antonio Borneo

--
View this message in context: http://old.nabble.com/Problem-with-warning%3A-gcrypt.h-%27...%27-is-deprecated-messages-tp32055337p32398900.html
Sent from the GnuPG - Libgcrypt - Dev mailing list archive at Nabble.com.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel


wk at gnupg

Sep 6, 2011, 1:46 AM

Post #5 of 6 (912 views)
Permalink
Re: Problem with warning: gcrypt.h '...' is deprecated messages [In reply to]

On Mon, 5 Sep 2011 08:26, borneo.antonio [at] gmail 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.


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel


borneo.antonio at gmail

Sep 7, 2011, 7:57 AM

Post #6 of 6 (916 views)
Permalink
Re: Problem with warning: gcrypt.h '...' is deprecated messages [In reply to]

On Tue, Sep 6, 2011 at 4:46 PM, Werner Koch <wk [at] gnupg> wrote:
> On Mon,  5 Sep 2011 08:26, borneo.antonio [at] gmail 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

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.