* [PATCH] Fix declaration guard for strcasecmp()
@ 2014-10-29 18:54 Jon TURNEY
2014-10-29 18:58 ` Eric Blake
2014-10-29 19:55 ` Corinna Vinschen
0 siblings, 2 replies; 3+ messages in thread
From: Jon TURNEY @ 2014-10-29 18:54 UTC (permalink / raw)
To: newlib
[-- Attachment #1: Type: text/plain, Size: 370 bytes --]
Based on [1], I think that strcasecmp() should be declared by string.h
if _BSD_VISIBLE or _POSIX_VISIBLE, the same as strncasecmp() a few lines
further down.
Patch attached.
2014-10-29 Jon Turney <jon.turney@dronecode.org.uk>
* libc/include/string.h: Correct guard for strcasecmp().
[1] http://pubs.opengroup.org/onlinepubs/009695399/functions/strcasecmp.html
[-- Attachment #2: string_h_strcasecmp.patch --]
[-- Type: text/plain, Size: 665 bytes --]
Index: libc/include/string.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/string.h,v
retrieving revision 1.38
diff -u -u -p -r1.38 string.h
--- libc/include/string.h 8 Oct 2014 21:04:59 -0000 1.38
+++ libc/include/string.h 29 Oct 2014 18:31:07 -0000
@@ -69,7 +69,7 @@ char *_EXFUN(rindex,(const char *, int)
#endif
char *_EXFUN(stpcpy,(char *__restrict, const char *__restrict));
char *_EXFUN(stpncpy,(char *__restrict, const char *__restrict, size_t));
-#if __BSD_VISIBLE
+#if __BSD_VISIBLE || __POSIX_VISIBLE
int _EXFUN(strcasecmp,(const char *, const char *));
#endif
#if __GNU_VISIBLE
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix declaration guard for strcasecmp()
2014-10-29 18:54 [PATCH] Fix declaration guard for strcasecmp() Jon TURNEY
@ 2014-10-29 18:58 ` Eric Blake
2014-10-29 19:55 ` Corinna Vinschen
1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2014-10-29 18:58 UTC (permalink / raw)
To: Jon TURNEY, newlib
[-- Attachment #1: Type: text/plain, Size: 640 bytes --]
On 10/29/2014 12:54 PM, Jon TURNEY wrote:
>
> Based on [1], I think that strcasecmp() should be declared by string.h
> if _BSD_VISIBLE or _POSIX_VISIBLE, the same as strncasecmp() a few lines
> further down.
POSIX doesn't require strcasecmp or strncasecmp to be visible in
<string.h> (they are only mandatory in <strings.h>). But it also
permits <string.h> to declare anything it wants in the str* namespace,
so this is still standards compliant, and closer to what lazy
programmers have gotten used to with glibc.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix declaration guard for strcasecmp()
2014-10-29 18:54 [PATCH] Fix declaration guard for strcasecmp() Jon TURNEY
2014-10-29 18:58 ` Eric Blake
@ 2014-10-29 19:55 ` Corinna Vinschen
1 sibling, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2014-10-29 19:55 UTC (permalink / raw)
To: newlib
[-- Attachment #1: Type: text/plain, Size: 423 bytes --]
On Oct 29 18:54, Jon TURNEY wrote:
>
> Based on [1], I think that strcasecmp() should be declared by string.h if
> _BSD_VISIBLE or _POSIX_VISIBLE, the same as strncasecmp() a few lines
> further down.
>
> Patch attached.
>
> 2014-10-29 Jon Turney <...>
>
> * libc/include/string.h: Correct guard for strcasecmp().
Thanks, please apply.
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-29 19:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-29 18:54 [PATCH] Fix declaration guard for strcasecmp() Jon TURNEY
2014-10-29 18:58 ` Eric Blake
2014-10-29 19:55 ` Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).