Bug #8522

r41264 causes "implicit conversion loses integer precision" on clang

Added by Eric Hodel 11 months ago. Updated 11 months ago.

[ruby-core:55467]
Status:Closed
Priority:Normal
Assignee:Akira Tanaka
Category:core
Target version:2.1.0
ruby -v:- Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

=begin
compiling ../trunk/bignum.c
../trunk/bignum.c:1128:46: error: implicit conversion loses integer precision:
'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
nlpbitsret = numbdigits * BITSPERDIG - numbits;
~ ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
1 error generated.
make: *
* [bignum.o] Error 1

=end

bignum.c.bug8522.patch Magnifier (1.92 KB) Eric Hodel, 06/13/2013 05:29 AM

Associated revisions

Revision 41267
Added by Akira Tanaka 11 months ago

  • bignum.c (integerunpacknumbdigitssmall): Fix a comple error on clang -Werror,-Wshorten-64-to-32 Reported by Eric Hodel. [Bug #8522]

History

#1 Updated by Eric Hodel 11 months ago

This patch changes int nlpbits to sizet nlp_bits, but I don't know enough about bignum.c to know if this is appropriate.

#2 Updated by Akira Tanaka 11 months ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r41267.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • bignum.c (integerunpacknumbdigitssmall): Fix a comple error on clang -Werror,-Wshorten-64-to-32 Reported by Eric Hodel. [Bug #8522]

Also available in: Atom PDF