diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-01 05:43:22 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-01 05:43:22 +0000 |
commit | a394c59be36d8b318e158db4ad852a107121c590 (patch) | |
tree | 7e3024b13b67927760d2ee52e78c4bfbd855f934 /ext/bigdecimal | |
parent | b2e137c81e70ca23676d5847be8719db8df2e5a6 (diff) | |
download | ruby-a394c59be36d8b318e158db4ad852a107121c590.tar.gz |
* ext/bigdecimal/bigdecimal.h (Real): suppress false warning from
clang. [ruby-core:41418] [Bug#5693]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r-- | ext/bigdecimal/bigdecimal.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/bigdecimal/bigdecimal.h b/ext/bigdecimal/bigdecimal.h index d6a3f337c6..80d2af20d7 100644 --- a/ext/bigdecimal/bigdecimal.h +++ b/ext/bigdecimal/bigdecimal.h @@ -120,6 +120,12 @@ extern VALUE rb_cBigDecimal; #define VP_SIGN_POSITIVE_INFINITE 3 /* Positive infinite number */ #define VP_SIGN_NEGATIVE_INFINITE -3 /* Negative infinite number */ +#ifdef __GNUC__ +#define FLEXIBLE_ARRAY_SIZE 0 +#else +#define FLEXIBLE_ARRAY_SIZE 1 +#endif + /* * VP representation * r = 0.xxxxxxxxx *BASE**exponent @@ -144,7 +150,7 @@ typedef struct { * -3 : Negative infinite number */ short flag; /* Not used in vp_routines,space for user. */ - BDIGIT frac[1]; /* Pointer to array of fraction part. */ + BDIGIT frac[FLEXIBLE_ARRAY_SIZE]; /* Array of fraction part. */ } Real; /* |