]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix non portability spotted by Florian:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Thu, 12 Mar 2015 22:46:58 +0000 (22:46 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Thu, 12 Mar 2015 22:46:58 +0000 (22:46 +0000)
An array must have at least 1 element.
0 element is accepted by gcc but is not portable.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15006

coregrind/m_aspacemgr/aspacemgr-common.c

index c41de1f359dc7964939d08932181bea405144747..20a1783661f59520394b592b594cea2add214ccd 100644 (file)
@@ -354,7 +354,9 @@ Bool ML_(am_resolve_filename) ( Int fd, /*OUT*/HChar* buf, Int nbuf )
 /*---                                                           ---*/
 /*-----------------------------------------------------------------*/
 struct _VgStack {
-   HChar bytes[0];
+   HChar bytes[1];
+   // We use a fake size of 1. A bigger size is allocated
+   // by VG_(am_alloc_VgStack).
 };
 
 /* Allocate and initialise a VgStack (anonymous valgrind space).