Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x11-toolkits/open-motif*: revise AM_FUNC_VOID_SPRINTF
The check for whether sprintf() returns void would fail to detect sprintf() returning int under recent Clang. Presumably the check meant to see if an error like "passing 'void' to parameter of incompatible type 'int'" is generated, but Clang would always generate other errors having to do with calling sprintf() with too few arguments and attempting to redeclare sprintf() when it is a builtin macro. And even if the test program compiles, such as with GCC, it crashes during the sprintf(".") call. Revise the test program to not redeclare sprintf(), to call sprintf() with valid arguments, and to not implicitly declare exit() due to stdlib.h not being included (which Apple Xcode Clang 12 and later consider an error rather than a warning). If sprintf() returns void, then a compiler error similar to "initializing 'int' with an expression of incompatible type 'void'" or "void value not ignored as it ought to be" should be generated. Otherwise if sprintf() returns int, then the test program should compile and exit with code 0, and the check should properly report that sprintf() does not return void. Obtained from: https://sourceforge.net/p/motif/code/merge-requests/3/
- Loading branch information