Skip to contentSkip to conversation

Why __memrchr vs. memrchr ?

DISCUSSION Denis Zaitsev 3 participants 5 messages Feb 2, 2004 – Feb 6, 2004

lore
Share & tools
lore
#0 lore raw

Why such a scheme is used in GLIBC:

declare + define __memrchr, and than

# ifdef __USE_GNU
#  define memrchr(s, c, n) __memrchr ((s), (c), (n))
# endif

? memrchr is not the GNU extension, is it?

Thanks in advance.

#1 lore raw

Hi,

Quoted 9 lines · Denis Zaitsev

Why such a scheme is used in GLIBC:

declare + define __memrchr, and than

# ifdef __USE_GNU
#  define memrchr(s, c, n) __memrchr ((s), (c), (n))
# endif

? memrchr is not the GNU extension, is it?

According to memchr(3),
"The memrchr() function is a GNU extension, available since glibc 2.1.91".

Signature · 1 line
ldv
#2 lore raw
Quoted 7 lines · Dmitry V. Levin

Hi,

Quoted 4 lines · Denis Zaitsev

Why such a scheme is used in GLIBC:

declare + define __memrchr, and than

Quoted 8 lines
Quoted 5 lines
# ifdef __USE_GNU
#  define memrchr(s, c, n) __memrchr ((s), (c), (n))
# endif

? memrchr is not the GNU extension, is it?

According to memchr(3),
"The memrchr() function is a GNU extension, available since glibc 2.1.91".

Oh, I'm sorry. This fact is omited from the texinfo GLIBC documentation...

Thanks.

#3 lore raw
Quoted 12 lines · Denis Zaitsev
Quoted 11 lines · Dmitry V. Levin

Hi,

Quoted 8 lines · Denis Zaitsev

Why such a scheme is used in GLIBC:

declare + define __memrchr, and than

# ifdef __USE_GNU
#  define memrchr(s, c, n) __memrchr ((s), (c), (n))
# endif
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

? memrchr is not the GNU extension, is it?

According to memchr(3),
"The memrchr() function is a GNU extension, available since glibc 2.1.91".

Oh, I'm sorry. This fact is omited from the texinfo GLIBC documentation...

It's in the Library Summary:
`void * memrchr (const void *BLOCK, int C, size_t SIZE)'
`string.h' (GNU): *Note Search Functions::.

Andreas

Signature · 3 lines
 Andreas Jaeger, [email protected], http://www.suse.de/~aj
  SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126
#4 lore raw
Quoted 7 lines · Andreas Jaeger
Quoted 5 lines · Denis Zaitsev
Quoted 3 lines · Dmitry V. Levin

According to memchr(3),
"The memrchr() function is a GNU extension, available since glibc 2.1.91".

Quoted 6 lines
Quoted 2 lines

Oh, I'm sorry. This fact is omited from the texinfo GLIBC documentation...

It's in the Library Summary:
`void * memrchr (const void *BLOCK, int C, size_t SIZE)'
`string.h' (GNU): *Note Search Functions::.

Indeed, it's shortly marked as (GNU) here and there. But that's not described in the texi manual. So, below is the tiny patch. Please, apply it.

string.texi renamed from string.texi.orig +2 -0
@@ -1625,6 +1625,8 @@ This function is a GNU extension.
 The function @code{memrchr} is like @code{memchr}, except that it searches
 backwards from the end of the block defined by @var{block} and @var{size}
 (instead of forwards from the front).
+
+This function is a GNU extension.
 @end deftypefun
 
 @comment string.h