Details

[Home]

Issue of the Standard # S0012

Brief

Contradiction in the description of the strspn() function.

Detailed Description

The ‘DESCRIPTION’ section for the function strspn() states that “the strspn() function shall compute the length (in bytes) of the maximum initial segment of the string pointed to by s1 which consists entirely of bytes from the string pointed to by s2”. This information conflicts with the ‘RETURN VALUE’ section that states that “the strspn() function shall return the length of s1”.

Problem location(s) in the standard

The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition (SUS 3.0), System Interfaces, description of the function <nobr>strspn()</nobr>.

Possible solutions

Change the 'RETURN VALUE' from:
“The strspn() function shall return the length of s1; no return value is reserved to indicate an error.”
to:
“The strspn() function shall return the length (in bytes) of the maximum initial segment of the string pointed to by s1 which consists entirely of bytes from the string pointed to by s2; no return value is reserved to indicate an error.”

Accepted

POSIX aardvark,
Request Number 182

[Home]