summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r--generic/tclInt.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index b983b81..d79937f 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -925,6 +925,12 @@ typedef struct VarInHash {
*----------------------------------------------------------------
*/
+#if defined(__GNUC__) && (__GNUC__ > 2)
+# define TCLFLEXARRAY 0
+#else
+# define TCLFLEXARRAY 1
+#endif
+
/*
* Forward declaration to prevent an error when the forward reference to
* Command is encountered in the Proc and ImportRef types declared below.
@@ -968,7 +974,7 @@ typedef struct CompiledLocal {
* is marked by a unique tag during
* compilation, and that same tag is used to
* find the variable at runtime. */
- char name[1]; /* Name of the local variable starts here. If
+ char name[TCLFLEXARRAY]; /* Name of the local variable starts here. If
* the name is NULL, this will just be '\0'.
* The actual size of this field will be large
* enough to hold the name. MUST BE THE LAST
@@ -1306,7 +1312,7 @@ typedef struct CFWordBC {
typedef struct ContLineLoc {
int num; /* Number of entries in loc, not counting the
* final -1 marker entry. */
- int loc[1]; /* Table of locations, as character offsets.
+ int loc[TCLFLEXARRAY];/* Table of locations, as character offsets.
* The table is allocated as part of the
* structure, extending behind the nominal end
* of the structure. An entry containing the