0-length array in c986a7310bb06582b7d8a566d5f007ba4e5e75bf

Albert Chin <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <20130903213457.GC26879@china>
Commit c986a7310bb06582b7d8a566d5f007ba4e5e75bf introduced the
following code to src/cairo-image-compositor.c:
--- a/src/cairo-image-compositor.c
+++ b/src/cairo-image-compositor.c
@@ -1547,7 +1547,8 @@ typedef struct _cairo_image_span_renderer {
            uint8_t *data;
        } mask;
     } u;
-    uint8_t buf[sizeof(cairo_abstract_span_renderer_t)-128];
+    uint8_t _buf[0];
+#define SZ_BUF (sizeof (cairo_abstract_span_renderer_t) - sizeof (cairo_image_span_renderer_t))
 } cairo_image_span_renderer_t;
 COMPILE_TIME_ASSERT (sizeof (cairo_image_span_renderer_t) <= sizeof (cairo_abstract_span_renderer_t));

The Solaris 8 compiler and the HP-UX/IA compilers don't like the
above. The Solaris 8 compiler errors with:
  "cairo-image-compositor.c", line 1551: zero or negative subscript
and the HP-UX/IA compilers error with:
  "cairo-image-compositor.c", line 1551: error #2094: the size of an array must
            be greater than zero
        uint8_t _buf[0];
                     ^

-- 
albert chin ([email protected])
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.