I have identified the difference between the builds of m4 1.4.16 on darwin11, which doesn't exhibit the test-vasprintf-posix failure in the m4 testsuite, and darwin12 which does. The key change in the configure output is...
@@ -210,7 +210,7 @@ checking whether printf supports 'long double' arguments... yes checking whether printf supports infinite 'double' arguments... yes checking whether printf supports infinite 'long double' arguments... no -checking whether printf supports the 'a' and 'A' directives... no +checking whether printf supports the 'a' and 'A' directives... yes checking whether printf supports the 'F' directive... yes checking whether printf supports the 'n' directive... yes checking whether printf supports the 'ls' directive... yes So on darwin12 and later, appending gl_cv_func_printf_directive_a=no to the configure options eliminates the test-vasprintf-posix failure. Note that on darwin12, the tests in question in config.log looks like... configure:15360: checking whether printf supports the 'a' and 'A' directives configure:15447: gcc -o conftest -Os -I/sw/include -L/sw/lib conftest.c >&5 conftest.c:148:48: warning: data argument not used by format string [-Wformat-extra-args] if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 ~~~~~~~ ^ /usr/include/secure/_stdio.h:49:56: note: expanded from macro 'sprintf' __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) ^ conftest.c:154:49: warning: data argument not used by format string [-Wformat-extra-args] if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0 ~~~~~~~ ^ /usr/include/secure/_stdio.h:49:56: note: expanded from macro 'sprintf' __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) ^ conftest.c:161:42: warning: data argument not used by format string [-Wformat-extra-args] if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 ~~~~~~~~~ ^ /usr/include/secure/_stdio.h:49:56: note: expanded from macro 'sprintf' __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) ^ conftest.c:169:48: warning: data argument not used by format string [-Wformat-extra-args] if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0 ~~~~~~~~~~ ^ /usr/include/secure/_stdio.h:49:56: note: expanded from macro 'sprintf' __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) ^ 4 warnings generated. configure:15447: $? = 0 configure:15447: ./conftest configure:15447: $? = 0 configure:15458: result: yes Interetingly, using -D_FORTIFY_SOURCE=0 doesn't seem to suppress the failures whereas disabling the detection of the printf supports the 'a' and 'A' directives to always be no does. Jack