Bug #3721

sys/ctype.h should pragma inline isxdigit

Added by Joshua M. Clulow almost 8 years ago. Updated almost 5 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


The file sys/ctype.h contains what appears to be a typographical error resulting from over-vigorous copying and pasting, resulting in isdigit being inlined twice and isxdigit not at all.


static boolean_t
isdigit(char c)
        return (ISDIGIT(c));
#pragma inline(isdigit)

static boolean_t
isxdigit(char c)
        return (ISXDIGIT(c));
#pragma inline(isdigit)

Updated by Ian Collins almost 8 years ago

Is the pragma necessary at all? Studio or gcc would inline these in an optimised build either way.


Updated by Rich Lowe almost 8 years ago

For our own uses we intentionally try to prevent the compiler making inlining decisions we haven't directed. More than likely it does matter, in the sense that it really does affect whether it is inlined -- whether there's a noticable result is probably a bit more up in the air.

Note that GCC will ignore that pragma anyway.


Updated by Ian Collins almost 8 years ago

Testing with the current Studio C compiler, the pragma is ignored. The function is inlined from -XO4. If the function is declared "static inline" it is inlined by Studio from -XO3. It is always inlined by gcc from -O1.

So the best fix appears to be "static inline".


Updated by Garrett D'Amore almost 6 years ago

  • Assignee set to Garrett D'Amore

Updated by Gary Mills almost 5 years ago

The typographical error seems to have been corrected.

This bug can be closed.


Updated by Garrett D'Amore almost 5 years ago

Fixed here:

commit 6b1aed11aada50610fd9f5a9e033c24ca7ee5f0c
Author: Richard PALO <>
Date: Sat Sep 5 13:08:15 2015 +0200

6201 cleanup issues between sys/ctype.h and sys/kobj_lex.h when both included
Reviewed by: Josef Sipek &lt;&gt;
Approved by: Richard Lowe &lt;&gt;

Updated by Garrett D'Amore almost 5 years ago

  • Status changed from New to Closed

Also available in: Atom PDF