[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNUTLS 2.8.5: Assertion failed on Solaris 8 Sparc
From: |
Simon Josefsson |
Subject: |
Re: GNUTLS 2.8.5: Assertion failed on Solaris 8 Sparc |
Date: |
Thu, 05 Nov 2009 14:23:32 +0100 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) |
Eric Blake <address@hidden> 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;
}