문제

When I compile a sample program with GCRYPT_NO_DEPRECATED defined, I get the following 6 warnings:

/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1336: warning: ‘gcry_ac_io_mode_t’ is deprecated
/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1337: warning: ‘gcry_ac_io_type_t’ is deprecated
/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1344: warning: ‘gcry_ac_data_read_cb_t’ is deprecated
/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1358: warning: ‘gcry_ac_data_write_cb_t’ is deprecated
/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1393: warning: ‘gcry_md_algo_t’ is deprecated
/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1401: warning: ‘gcry_md_algo_t’ is deprecated

Manually defining _GCRYPT_IN_LIBGCRYPT resolves the 6 warnings, but the manual is fairly strict in its exhortation:

name prefixes with one prepended underscore are reserved for internal use and should never be used by an application.

So how is one supposed to compile the gcrypt header without warnings?

도움이 되었습니까?

해결책

gcrypt author says, "This is a bug in some compilers"

Suggested work around is

#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
before the include, and
#pragma GCC diagnostic warning "-Wdeprecated-declarations"

http://lists.gnupg.org/pipermail/gcrypt-devel/2011-July/001829.html

http://lists.gnupg.org/pipermail/gcrypt-devel/2011-July/001830.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top