GNUTLS 2.8.5: Assertion failed on Solaris 8 Sparc

Simon Josefsson simon at josefsson.org
Thu Nov 5 14:23:32 CET 2009


Eric Blake <ebb9 at byu.net> writes:

> According to Simon Josefsson on 11/5/2009 6:02 AM:
>> A sizeof(__func__) == 0 seems odd.  What is __func__ on Solaris?  Is
>> there some other variable that contains the current function name on
>> Solaris?
>
> This is a known bug in the Solaris compiler, and gnulib just ignores the
> error.  This line from test-func.c is telling:
>
>>   /* 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

Ah, thanks.  But does __func__ work on Solaris?  Would it make sense to
improve the self-test like this?

/Simon

diff --git a/tests/test-func.c b/tests/test-func.c
index 8a3c465..3c2de3c 100644
--- a/tests/test-func.c
+++ b/tests/test-func.c
@@ -45,5 +45,8 @@ main ()
   ASSERT (strlen (__func__) + 1 == sizeof __func__);
 #endif
 
+  assert (strcmp (__func__, "main") == 0
+	  || strcmp (__func__, "<unknown function>") == 0);
+
   return 0;
 }





More information about the Gnutls-devel mailing list