# HG changeset patch # User Bruno Haible # Date 1232104908 -3600 # Node ID 9118fd8fdd2f9d34428e376ccaeb43e15019b777 # Parent 4494a99c424ddd795fc4c88ff6c03b335a8fb660 Use an array initializer syntax that also works in C++ mode. diff --git a/ChangeLog b/ChangeLog --- 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 --- 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 @@ #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 #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 } 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 @@ } 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'; }],