* XOPEN_SOURCE and strings.h
@ 2013-01-11 21:47 Denis Excoffier
2013-01-11 22:00 ` marco atzeri
2013-01-12 10:56 ` XOPEN_SOURCE and strings.h Corinna Vinschen
0 siblings, 2 replies; 5+ messages in thread
From: Denis Excoffier @ 2013-01-11 21:47 UTC (permalink / raw)
To: cygwin
Hello,
In order to compile some packages (including slang-2.2.4 and ccrypt-1.9)
with GCC-4.7.2, i had to patch /usr/include/string.h iaw the following:
diff -uNr x-o/usr/include/string.h x-p/usr/include/string.h
--- x-o/usr/include/string.h 2012-11-23 14:40:09.000000000 +0100
+++ x-p/usr/include/string.h 2013-01-11 22:29:39.000000000 +0100
@@ -64,13 +64,13 @@
char *_EXFUN(strcasestr,(const char *, const char *));
char *_EXFUN(strchrnul,(const char *, int));
#endif
-#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 500)
+#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 500)
char *_EXFUN(strdup,(const char *));
#endif
#ifndef __STRICT_ANSI__
char *_EXFUN(_strdup_r,(struct _reent *, const char *));
#endif
-#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 700)
+#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 700)
char *_EXFUN(strndup,(const char *, size_t));
#endif
#ifndef __STRICT_ANSI__
See also /usr/include/sys/features.h.
Otherwise i obtain the message:
/usr/include/string.h:67:49: error: operator '>=' has no left operand
/usr/include/string.h:73:49: error: operator '>=' has no left operand
Hope this helps,
Regards,
Denis Excoffier.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: XOPEN_SOURCE and strings.h
2013-01-11 21:47 XOPEN_SOURCE and strings.h Denis Excoffier
@ 2013-01-11 22:00 ` marco atzeri
2013-01-11 23:50 ` XOPEN_SOURCE and string.h Denis Excoffier
2013-01-12 10:56 ` XOPEN_SOURCE and strings.h Corinna Vinschen
1 sibling, 1 reply; 5+ messages in thread
From: marco atzeri @ 2013-01-11 22:00 UTC (permalink / raw)
To: cygwin
On 1/11/2013 10:47 PM, Denis Excoffier wrote:
> Hello,
>
> In order to compile some packages (including slang-2.2.4 and ccrypt-1.9)
> with GCC-4.7.2, i had to patch /usr/include/string.h iaw the following:
>
>
> diff -uNr x-o/usr/include/string.h x-p/usr/include/string.h
> --- x-o/usr/include/string.h 2012-11-23 14:40:09.000000000 +0100
> +++ x-p/usr/include/string.h 2013-01-11 22:29:39.000000000 +0100
> @@ -64,13 +64,13 @@
> char *_EXFUN(strcasestr,(const char *, const char *));
> char *_EXFUN(strchrnul,(const char *, int));
> #endif
> -#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 500)
> +#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 500)
> char *_EXFUN(strdup,(const char *));
> #endif
> #ifndef __STRICT_ANSI__
> char *_EXFUN(_strdup_r,(struct _reent *, const char *));
> #endif
> -#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 700)
> +#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 700)
> char *_EXFUN(strndup,(const char *, size_t));
> #endif
> #ifndef __STRICT_ANSI__
>
>
>
> See also /usr/include/sys/features.h.
>
> Otherwise i obtain the message:
>
> /usr/include/string.h:67:49: error: operator '>=' has no left operand
> /usr/include/string.h:73:49: error: operator '>=' has no left operand
>
> Hope this helps,
>
> Regards,
>
> Denis Excoffier.
>
>
are you sure about that file ?
_XOPEN_SOURCE is not present on string.h
$ cygcheck -f /usr/include/string.h
cygwin-1.7.17-1
$ grep XOPEN /usr/include/string.h
Regards
Marco
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: XOPEN_SOURCE and string.h
2013-01-11 22:00 ` marco atzeri
@ 2013-01-11 23:50 ` Denis Excoffier
2013-01-12 5:46 ` marco atzeri
0 siblings, 1 reply; 5+ messages in thread
From: Denis Excoffier @ 2013-01-11 23:50 UTC (permalink / raw)
To: marco atzeri; +Cc: cygwin
On 2013-01-11 23:00, marco atzeri wrote:
> On 1/11/2013 10:47 PM, Denis Excoffier wrote:
>> Hello,
>>
>> In order to compile some packages (including slang-2.2.4 and ccrypt-1.9)
>> with GCC-4.7.2, i had to patch /usr/include/string.h iaw the following:
>>
>>
>> diff -uNr x-o/usr/include/string.h x-p/usr/include/string.h
>> --- x-o/usr/include/string.h 2012-11-23 14:40:09.000000000 +0100
>> +++ x-p/usr/include/string.h 2013-01-11 22:29:39.000000000 +0100
>> @@ -64,13 +64,13 @@
>> char *_EXFUN(strcasestr,(const char *, const char *));
>> char *_EXFUN(strchrnul,(const char *, int));
>> #endif
>> -#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 500)
>> +#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 500)
>> char *_EXFUN(strdup,(const char *));
>> #endif
>> #ifndef __STRICT_ANSI__
>> char *_EXFUN(_strdup_r,(struct _reent *, const char *));
>> #endif
>> -#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 700)
>> +#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 700)
>> char *_EXFUN(strndup,(const char *, size_t));
>> #endif
>> #ifndef __STRICT_ANSI__
>>
>>
>>
>> See also /usr/include/sys/features.h.
>>
>> Otherwise i obtain the message:
>>
>> /usr/include/string.h:67:49: error: operator '>=' has no left operand
>> /usr/include/string.h:73:49: error: operator '>=' has no left operand
>>
>> Hope this helps,
>>
>> Regards,
>>
>> Denis Excoffier.
>>
>>
>
> are you sure about that file ?
Sure yes. It has been inside Cygwin snapshots since end of last December. It was
introduced in newlib near the 22nd October 2012. I suppose that other occurrences of
_XOPEN_SOURCE have to be checked.
% cygcheck -f /usr/include/string.h
cygwin-1.7.17-1
% uname -a
CYGWIN_NT-5.1 jupiter 1.7.18s(0.263/5/3) 20130111 15:37:20 i686 Cygwin
%
See http://cygwin.com/ml/cygwin/2011-02/msg00534.html (and many others).
Denis Excoffier.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: XOPEN_SOURCE and string.h
2013-01-11 23:50 ` XOPEN_SOURCE and string.h Denis Excoffier
@ 2013-01-12 5:46 ` marco atzeri
0 siblings, 0 replies; 5+ messages in thread
From: marco atzeri @ 2013-01-12 5:46 UTC (permalink / raw)
To: Denis Excoffier; +Cc: cygwin
On 1/12/2013 12:50 AM, Denis Excoffier wrote:
> On 2013-01-11 23:00, marco atzeri wrote:
>> On 1/11/2013 10:47 PM, Denis Excoffier wrote:
>>> Hello,
>>
>> are you sure about that file ?
> Sure yes. It has been inside Cygwin snapshots since end of last December. It was
> introduced in newlib near the 22nd October 2012. I suppose that other occurrences of
> _XOPEN_SOURCE have to be checked.
>
> % cygcheck -f /usr/include/string.h
> cygwin-1.7.17-1
> % uname -a
> CYGWIN_NT-5.1 jupiter 1.7.18s(0.263/5/3) 20130111 15:37:20 i686 Cygwin
> %
>
> See http://cygwin.com/ml/cygwin/2011-02/msg00534.html (and many others).
>
> Denis Excoffier.
>
looking at CVS source.
the one you found should be the only occurrence, and
it is coming from newlib
src/newlib/libc/include/string.h:#if !defined(__STRICT_ANSI__) ||
(_XOPEN_SOURCE >= 500)
src/newlib/libc/include/string.h:#if !defined(__STRICT_ANSI__) ||
(_XOPEN_SOURCE >= 700)
in the only other place it is already implemented like taht
src/newlib/libc/include/sys/features.h: #if (_XOPEN_SOURCE - 0) == 700
/* POSIX.1-2008 */
src/newlib/libc/include/sys/features.h: #elif (_XOPEN_SOURCE - 0) ==
600 /* POSIX.1-2001 or 2004 */
src/newlib/libc/include/sys/features.h: #elif (_XOPEN_SOURCE - 0) ==
500 /* POSIX.1-1995 */
src/newlib/libc/include/sys/features.h: #elif (_XOPEN_SOURCE - 0) <
500 /* really old */
and there is a specific note on the matter:
* _POSIX_C_SOURCE if _XOPEN_SOURCE is defined and _POSIX_C_SOURCE is not.
* (_XOPEN_SOURCE indicates that XSI extensions are desired by an
application.)
* Allow for _XOPEN_SOURCE to be empty (from the earliest form of it,
before it
Regards
Marco
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: XOPEN_SOURCE and strings.h
2013-01-11 21:47 XOPEN_SOURCE and strings.h Denis Excoffier
2013-01-11 22:00 ` marco atzeri
@ 2013-01-12 10:56 ` Corinna Vinschen
1 sibling, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2013-01-12 10:56 UTC (permalink / raw)
To: cygwin
On Jan 11 22:47, Denis Excoffier wrote:
> Hello,
>
> In order to compile some packages (including slang-2.2.4 and ccrypt-1.9)
> with GCC-4.7.2, i had to patch /usr/include/string.h iaw the following:
>
>
> diff -uNr x-o/usr/include/string.h x-p/usr/include/string.h
> --- x-o/usr/include/string.h 2012-11-23 14:40:09.000000000 +0100
> +++ x-p/usr/include/string.h 2013-01-11 22:29:39.000000000 +0100
> @@ -64,13 +64,13 @@
> char *_EXFUN(strcasestr,(const char *, const char *));
> char *_EXFUN(strchrnul,(const char *, int));
> #endif
> -#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 500)
> +#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 500)
> char *_EXFUN(strdup,(const char *));
> #endif
> #ifndef __STRICT_ANSI__
> char *_EXFUN(_strdup_r,(struct _reent *, const char *));
> #endif
> -#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 700)
> +#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 700)
> char *_EXFUN(strndup,(const char *, size_t));
> #endif
> #ifndef __STRICT_ANSI__
>
Thanks, I applied a patch.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-01-12 10:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-11 21:47 XOPEN_SOURCE and strings.h Denis Excoffier
2013-01-11 22:00 ` marco atzeri
2013-01-11 23:50 ` XOPEN_SOURCE and string.h Denis Excoffier
2013-01-12 5:46 ` marco atzeri
2013-01-12 10:56 ` XOPEN_SOURCE and strings.h 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).