当我用GCRYPT_NO_DEPRECATED定义的示例程序编译时,我会得到以下6个警告:
/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手动定义_GCRYPT_IN_LIBGCRYPT可以解决6种警告,但手册的告诫相当严格:
带有一个加号下划线的
名称前缀保留给内部使用,应用程序不应该使用。
那么,如何在没有警告的情况下编译gcrypt头呢?
发布于 2012-10-10 23:53:07
gcrypt作者说,“这是一些编译器中的一个bug”
建议的工作是
#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
https://stackoverflow.com/questions/10556299
复制相似问题