From: Bruno Haible Date: Fri, 16 Jan 2009 11:21:48 +0000 (+0100) Subject: Use an array initializer syntax that also works in C++ mode. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33e3c8522b95a5cfbfb595ca002401d44a9b5e8e;p=pspp Use an array initializer syntax that also works in C++ mode. --- diff --git a/ChangeLog b/ChangeLog index 9683602b08..143131ba6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-01-16 Bruno Haible + + * m4/printf.m4 (gl_SNPRINTF_SIZE1, gl_VSNPRINTF_ZEROSIZE_C99): Use an + array initializer syntax that also works in C++ mode. + Reported by Albert Chin . + 2009-01-16 Jim Meyering poll: suppress a warning diff --git a/m4/printf.m4 b/m4/printf.m4 index 4d109935d4..7c0ad900f0 100644 --- a/m4/printf.m4 +++ b/m4/printf.m4 @@ -1,4 +1,4 @@ -# printf.m4 serial 26 +# printf.m4 serial 27 dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -1142,7 +1142,7 @@ AC_DEFUN([gl_SNPRINTF_SIZE1], #include int main() { - static char buf[8] = "DEADBEEF"; + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; snprintf (buf, 1, "%d", 12345); return buf[1] != 'E'; }], @@ -1160,7 +1160,7 @@ dnl --------------------------------------------------------------------- dnl #include dnl int main() dnl { -dnl static char buf[8] = "DEADBEEF"; +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } @@ -1181,7 +1181,7 @@ dnl return ret; dnl } dnl int main() dnl { -dnl static char buf[8] = "DEADBEEF"; +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl my_snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } @@ -1209,7 +1209,7 @@ static int my_snprintf (char *buf, int size, const char *format, ...) } int main() { - static char buf[8] = "DEADBEEF"; + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; my_snprintf (buf, 0, "%d", 12345); return buf[0] != 'D'; }],