Project

General

Profile

Bug #3721

sys/ctype.h should pragma inline isxdigit

Added by Joshua M. Clulow about 7 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Start date:
2013-04-16
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

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.

Witness:

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

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

History

#1

Updated by Ian Collins about 7 years ago

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

#2

Updated by Rich Lowe about 7 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.

#3

Updated by Ian Collins about 7 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".

#4

Updated by Garrett D'Amore about 5 years ago

  • Assignee set to Garrett D'Amore
#5

Updated by Gary Mills about 4 years ago

The typographical error seems to have been corrected.

This bug can be closed.

#6

Updated by Garrett D'Amore about 4 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;
#7

Updated by Garrett D'Amore about 4 years ago

  • Status changed from New to Closed

Also available in: Atom PDF