From a394c59be36d8b318e158db4ad852a107121c590 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 1 Dec 2011 05:43:22 +0000 Subject: * 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 --- ext/bigdecimal/bigdecimal.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ext/bigdecimal') 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; /* -- cgit v1.2.3