Use FLEX_ARRAY instead of []
authorMarko Kreen <markokr@gmail.com>
Sat, 26 Feb 2011 11:06:22 +0000 (13:06 +0200)
committerMarko Kreen <markokr@gmail.com>
Sat, 26 Feb 2011 11:06:22 +0000 (13:06 +0200)
usual/base.h
usual/hashtab-impl.h
usual/strpool.h

index 2aa6387d6309547336c49964b1858891d597a2a9..0db0dd310e2eaec919850b8205a999d08ab05560 100644 (file)
@@ -84,7 +84,7 @@
 /* how to specify array with unknown length */
 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
 #define FLEX_ARRAY
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) && (__GNUC__ >= 3)
 #define FLEX_ARRAY
 #else
 #define FLEX_ARRAY 1
index 2b5402307218505d5a11eb62e23a9ab3c863e260..eaf54b3773275d88a4c7650a04211dfe4b9f1357 100644 (file)
@@ -79,7 +79,7 @@ struct HashTab {
        CxMem *ca;
        unsigned size;
        unsigned used;
-       struct HashItem tab[];
+       struct HashItem tab[FLEX_ARRAY];
 };
 
 /** Initialize HashTab */
index 085883fd46a7b2425d813afbc700c8f1168101d2..b1a8e6f839403b38deee8622798b5a2aa0417e5f 100644 (file)
@@ -42,7 +42,7 @@ struct PStr {
        /** String length */
        int len;
        /** Zero-terminated value */
-       char str[];
+       char str[FLEX_ARRAY];
 };
 
 /** Create new pool */