[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnutls-dev
Subject:    Re: GNUTLS 2.8.5: Assertion failed on Solaris 8 Sparc
From:       Simon Josefsson <simon () josefsson ! org>
Date:       2009-11-05 13:23:32
Message-ID: 87k4y5ds17.fsf () mocca ! josefsson ! org
[Download RAW message or body]

Eric Blake <ebb9@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;
 }


_______________________________________________
Gnutls-devel mailing list
Gnutls-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/gnutls-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic