summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/bigdecimal/bigdecimal.h8
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e02b84c2c1..802ec493aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Dec 1 14:43:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.h (Real): suppress false warning from
+ clang. [ruby-core:41418] [Bug#5693]
+
Thu Dec 1 10:31:55 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (LDFLAGS): -fstack-protector is always needed to
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;
/*