<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<p style="color: #777777;">
<a href="https://gitlab.com/roolebo">Roman Bolshakov</a>
<a href="https://gitlab.com/gnutls/libtasn1/-/issues/28#note_505357689">commented</a>:
</p>
<div style="">
<p dir="auto">I'm not sure if the issue is fixed. I can reproduce if libtasn1 is compiled with -O1.
Neither libgnu.a nor c-ctype.o have symbol of <code>c_isdigit</code>:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">$ nm lib/gl/.libs/libgnu.a</span>
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">lib/gl/.libs/libgnu.a(c-ctype.o):</span>
<span id="LC4" class="line" lang="plaintext">0000000000000000 t ltmp0</span>
<span id="LC5" class="line" lang="plaintext"></span>
<span id="LC6" class="line" lang="plaintext">lib/gl/.libs/libgnu.a(strverscmp.o):</span>
<span id="LC7" class="line" lang="plaintext">0000000000000000 T _strverscmp</span>
<span id="LC8" class="line" lang="plaintext">00000000000000ec s _strverscmp.next_state</span>
<span id="LC9" class="line" lang="plaintext">00000000000000f8 s _strverscmp.result_type</span>
<span id="LC10" class="line" lang="plaintext">0000000000000000 t ltmp0</span>
<span id="LC11" class="line" lang="plaintext">00000000000000ec s ltmp1</span>
<span id="LC12" class="line" lang="plaintext">0000000000000120 s ltmp2</span>
<span id="LC13" class="line" lang="plaintext">$ nm lib/gl/c-ctype.o</span>
<span id="LC14" class="line" lang="plaintext">0000000000000000 t ltmp0</span></code></pre>
<p dir="auto">If c-ctype.c is compiled with -E flag we can see that <code>c_isdigit</code> is declared as <code>static __attribute__ ((__unused__))</code>:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">static __attribute__ ((__unused__)) _Bool</span>
<span id="LC2" class="line" lang="plaintext">c_isdigit (int c)</span>
<span id="LC3" class="line" lang="plaintext">{</span>
<span id="LC4" class="line" lang="plaintext">  switch (c)</span>
<span id="LC5" class="line" lang="plaintext">    {</span>
<span id="LC6" class="line" lang="plaintext">    case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':</span>
<span id="LC7" class="line" lang="plaintext">      return 1;</span>
<span id="LC8" class="line" lang="plaintext">    default:</span>
<span id="LC9" class="line" lang="plaintext">      return 0;</span>
<span id="LC10" class="line" lang="plaintext">    }</span>
<span id="LC11" class="line" lang="plaintext">}</span></code></pre>
<p dir="auto">The function is static and compiler doesn't see if it's used so it optimizes it out and that's why the symbol is not available in c-ctype.o.
If we look closer how <code>c_isdigit</code> is defined we can notice it's defined with <code>C_CTYPE_INLINE</code>:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">C_CTYPE_INLINE bool</span>
<span id="LC2" class="line" lang="plaintext">c_isdigit (int c)</span>
<span id="LC3" class="line" lang="plaintext">{</span>
<span id="LC4" class="line" lang="plaintext">  switch (c)</span>
<span id="LC5" class="line" lang="plaintext">    {</span>
<span id="LC6" class="line" lang="plaintext">    _C_CTYPE_DIGIT:</span>
<span id="LC7" class="line" lang="plaintext">      return true;</span>
<span id="LC8" class="line" lang="plaintext">    default:</span>
<span id="LC9" class="line" lang="plaintext">      return false;</span>
<span id="LC10" class="line" lang="plaintext">    }</span>
<span id="LC11" class="line" lang="plaintext">}</span></code></pre>
<p dir="auto">The symbol is assigned to <code>_GL_EXTERN_INLINE</code> in c-ctype.c:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">#include <config.h></span>
<span id="LC2" class="line" lang="plaintext">#define C_CTYPE_INLINE _GL_EXTERN_INLINE</span>
<span id="LC3" class="line" lang="plaintext">#include "c-ctype.h"</span></code></pre>
<p dir="auto">_GL_EXTERN_INLINE is supposed to be <a href="https://www.gnu.org/software/gnulib/manual/html_node/extern-inline.html" rel="nofollow noreferrer noopener" target="_blank">portable "extern inline"</a> but it doesn't seem to work as intended on modern macOS. I think the issue is caused by incorrect _GL_EXTERN_INLINE definition inside gnulib.</p>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/libtasn1/-/issues/28#note_505357689">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/-/sent_notifications/ac6c5e3bf852ab1099baafd33da5cc45/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/libtasn1/-/issues/28#note_505357689"}}</script>


</p>
</div>
</body>
</html>