From: Yui NARUSE Date: 2011-12-01T11:02:32+09:00 Subject: [ruby-core:41427] [ruby-trunk - Bug #5693][Assigned] clang warning in bigdecimal Issue #5693 has been updated by Yui NARUSE. Category set to ext Status changed from Open to Assigned Assignee set to Kenta Murata ---------------------------------------- Bug #5693: clang warning in bigdecimal http://redmine.ruby-lang.org/issues/5693 Author: Eric Hodel Status: Assigned Priority: Normal Assignee: Kenta Murata Category: ext Target version: ruby -v: - When bigdecimal is compiled under clang I get this warning: /Users/drbrain/Work/svn/ruby/trunk/ext/bigdecimal compiling bigdecimal.c bigdecimal.c:4364:37: warning: array index of '1' indexes past the end of an array (that contains 1 elements) [-Warray-bounds] b1b2p1 = b1b2 = b1 * BASE + b->frac[1]; ^ ~ ./bigdecimal.h:147:5: note: array 'frac' declared here BDIGIT frac[1]; /* Pointer to array of fraction part. */ ^ ../.././include/ruby/defines.h:93:17: note: instantiated from: # define BDIGIT unsigned int ^ 1 warning generated. linking shared-object bigdecimal.bundle installing default bigdecimal libraries Paste of warning in case spacing is munged: http://paste.segment7.net/or.html I'm using Apple clang 3.0: $ clang -v Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn) Target: x86_64-apple-darwin11.2.0 Thread model: posix I dug around in the bigdecimal and it seems that frac is modified to point to a larger array, but perhaps clang has detected a scenario where it is not modified? -- http://redmine.ruby-lang.org