The testcase for pr 66345 assumes size_t is "unsigned long" instead of
using the real type, which causes failures on some 16-bit targets.
Ok?

Also, I note that some tests check for __SIZE_TYPE__ as I do below,
and others use it unconditionally as a replacement for size_t.  Is
there a convention?

        * gcc.dg/torture/pr66345.c: Fix assumption about size_t type.
 
 2015-06-08  Tom de Vries  <t...@codesourcery.com>
Index: gcc.dg/torture/pr66345.c
===================================================================
--- gcc.dg/torture/pr66345.c    (revision 224260)
+++ gcc.dg/torture/pr66345.c    (working copy)
@@ -1,9 +1,15 @@
 /* { dg-do compile } */
 
-extern int snprintf (char *, unsigned long, const char *, ...);
+#ifdef __SIZE_TYPE__
+typedef __SIZE_TYPE__ size_t;
+#else
+typedef unsigned int size_t;
+#endif
+
+extern int snprintf (char *, size_t, const char *, ...);
 const char a[] = "";
 int b;
 void
 get_bar ()
 {
   snprintf (0, 0, "%s", &a[b]);

Reply via email to