+2009-08-27 Bruno Haible <bruno@clisp.org>
+
+ * tests/test-func.c (main): Don't verify sizeof __func__ on SunPRO C
+ compilers.
+ * doc/func.texi: Document the SunPRO C bug.
+
2009-08-27 Bruno Haible <bruno@clisp.org>
Fix link error on Solaris.
printf ("%s: hello world\n", __func__);
@}
@end smallexample
+
+Note that @code{sizeof} cannot be applied to @code{__func__}: On SunPRO C
+compiler, @code{sizeof __func__} evaluates to 0.
/* Test whether __func__ is available
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
int
main ()
{
+ ASSERT (strlen (__func__) > 0);
+
+ /* On SunPRO C 5.9, sizeof __func__ evaluates to 0. The compiler warns:
+ "warning: null dimension: sizeof()". */
+#if !defined __SUNPRO_C
ASSERT (strlen (__func__) + 1 == sizeof __func__);
+#endif
+
return 0;
}