Permalink
Browse files

Tweak the initialization in `CREATE()` to work around gcc deficiencies

  • Loading branch information...
1 parent 6544b62 commit 9a8436fcbfbe2907e55513fd1b424b266abc51d5 david parsons committed Jan 13, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 cstring.h
View
@@ -18,7 +18,7 @@
*/
#define STRING(type) struct { type *text; int size, alloc; }
-#define CREATE(x) T(x) = (void*)(S(x) = (x).alloc = 0)
+#define CREATE(x) ( (T(x) = (void*)0), (S(x) = (x).alloc = 0) )
#define EXPAND(x) (S(x)++)[(S(x) < (x).alloc) \
? (T(x)) \
: (T(x) = T(x) ? realloc(T(x), sizeof T(x)[0] * ((x).alloc += 100)) \

0 comments on commit 9a8436f

Please sign in to comment.