ueno / ruby-gpgme

a ruby interface to GnuPG Made Easy (GPGME).
GNU Lesser General Public License v2.1
232 stars 99 forks source link

Current warnings #185

Open djberg96 opened 9 months ago

djberg96 commented 9 months ago

This is what I see when I run bundle exec rake test against master, using Ruby 3.2.2 on Ubuntu:

/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c: In function ‘rb_s_gpgme_data_new_from_mem’:
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:302:28: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  302 |   if (RSTRING_LEN(vbuffer) < size)
      |                            ^
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c: In function ‘rb_s_gpgme_get_ctx_flag’:
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:541:7: warning: unused variable ‘yes’ [-Wunused-variable]
  541 |   int yes;
      |       ^~~
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c: In function ‘rb_s_gpgme_op_keylist_start’:
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:951:34: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
  951 |     SET_KEYLIST_IN_PROGRESS(vctx);
      |                                  ^
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c: In function ‘rb_s_gpgme_op_keylist_ext_start’:
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:981:34: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
  981 |     SET_KEYLIST_IN_PROGRESS(vctx);
      |                                  ^
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c: In function ‘rb_s_gpgme_op_edit’:
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:1545:3: warning: ‘gpgme_op_edit’ is deprecated [-Wdeprecated-declarations]
 1545 |   err = gpgme_op_edit (ctx, key, edit_cb, (void *)vcb, out);
      |   ^~~
In file included from /home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:43:
/home/dberger/Dev/ruby-gpgme/ports/x86_64-linux-gnu/gpgme/1.21.0/include/gpgme.h:2648:15: note: declared here
 2648 | gpgme_error_t gpgme_op_edit       (gpgme_ctx_t ctx, gpgme_key_t key,
      |               ^~~~~~~~~~~~~
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c: In function ‘rb_s_gpgme_op_edit_start’:
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:1574:3: warning: ‘gpgme_op_edit_start’ is deprecated [-Wdeprecated-declarations]
 1574 |   err = gpgme_op_edit_start (ctx, key, edit_cb, (void *)vcb, out);
      |   ^~~
In file included from /home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:43:
/home/dberger/Dev/ruby-gpgme/ports/x86_64-linux-gnu/gpgme/1.21.0/include/gpgme.h:2645:15: note: declared here
 2645 | gpgme_error_t gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
      |               ^~~~~~~~~~~~~~~~~~~
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c: In function ‘rb_s_gpgme_op_card_edit’:
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:1603:3: warning: ‘gpgme_op_card_edit’ is deprecated [-Wdeprecated-declarations]
 1603 |   err = gpgme_op_card_edit (ctx, key, edit_cb, (void *)vcb, out);
      |   ^~~
In file included from /home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:43:
/home/dberger/Dev/ruby-gpgme/ports/x86_64-linux-gnu/gpgme/1.21.0/include/gpgme.h:2655:15: note: declared here
 2655 | gpgme_error_t gpgme_op_card_edit       (gpgme_ctx_t ctx, gpgme_key_t key,
      |               ^~~~~~~~~~~~~~~~~~
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c: In function ‘rb_s_gpgme_op_card_edit_start’:
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:1632:3: warning: ‘gpgme_op_card_edit_start’ is deprecated [-Wdeprecated-declarations]
 1632 |   err = gpgme_op_card_edit_start (ctx, key, edit_cb, (void *)vcb, out);
      |   ^~~
In file included from /home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c:43:
/home/dberger/Dev/ruby-gpgme/ports/x86_64-linux-gnu/gpgme/1.21.0/include/gpgme.h:2651:15: note: declared here
 2651 | gpgme_error_t gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
      |               ^~~~~~~~~~~~~~~~~~~~~~~~
/home/dberger/Dev/ruby-gpgme/ext/gpgme/gpgme_n.c: At top level:
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics
/home/dberger/.rbenv/versions/3.2.2/bin/ruby -w -I"lib:test" /home/dberger/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb "test/crypto_test.rb" "test/ctx_test.rb" "test/data_test.rb" "test/gpgme_test.rb" "test/key_test.rb" "test/signature_test.rb" "test/sub_key_test.rb" 
/home/dberger/Dev/ruby-gpgme/test/ctx_test.rb:73: warning: assigned but unused variable - cipher
/home/dberger/Dev/ruby-gpgme/test/ctx_test.rb:74: warning: assigned but unused variable - ouput
/home/dberger/Dev/ruby-gpgme/test/ctx_test.rb:217: warning: assigned but unused variable - ctx
/home/dberger/Dev/ruby-gpgme/test/data_test.rb:28: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
/home/dberger/Dev/ruby-gpgme/test/data_test.rb:35: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
stanhu commented 2 months ago

It looks like we'll have to update these deprecated functions: https://www.gnupg.org/documentation/manuals/gpgme/Deprecated-Functions.html