From: Michael Stefaniuc <mstefani@redhat.com>
To: Yura Pakhuchiy <pakhuchiy@gmail.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: L'\0' handling
Date: Thu, 08 Apr 2010 17:22:40 +0200 [thread overview]
Message-ID: <4BBDF4C0.8020305@redhat.com> (raw)
In-Reply-To: <1270738799.2167.7.camel@yura-tl>
Hello,
Yura Pakhuchiy wrote:
> It looks like sparse do not understand constructions like L'\0'.
yepp, it doesn't. I have run into that problem 2 years ago. But for Wine
that is actually a "feature" as wide char/string literals are forbidden
aka cannot be used. Thus my interest in adding support for that in
sparse died.
bye
michael
>
> .-(~)------------------------------------------------------------(yura@yura-tl)-
> `--> cat b.c
> int main(void)
> {
> L'\0';
> return 0;
> }
> .-(~)------------------------------------------------------------(yura@yura-tl)-
> `--> gcc b.c
> .-(~)------------------------------------------------------------(yura@yura-tl)-
> `--> cgcc b.c
> b.c:3:10: error: Expected ; at end of statement
> b.c:3:10: error: got `\0'
> b.c:3:9: error: undefined identifier `L'
>
> This causes problems with /usr/include/wchar.h
> and /usr/include/bits/wchar.h includes from ubuntu.
>
> /usr/include/bits/wchar.h:38:8: error: garbage at end: `\0' - 1 > 0
>
> /usr/include/wchar.h:393:51: error: Expected ) in expression
> /usr/include/wchar.h:393:51: error: got `\0'
>
> Relevant lines from these headers:
>
> extern int __wctob_alias (wint_t __c) __asm ("wctob");
> __extern_inline int
> __NTH (wctob (wint_t __wc))
> { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f'
> ? (int) __wc : __wctob_alias (__wc)); }
>
> and
>
> #ifdef __WCHAR_UNSIGNED__
> #define __WCHAR_MIN L'\0'
>
> /* Failing that, rely on the preprocessor's knowledge of the
> signedness of wchar_t. */
> #elif L'\0' - 1 > 0
> #define __WCHAR_MIN L'\0'
> #else
> #define __WCHAR_MIN (-__WCHAR_MAX - 1)
> #endif
next prev parent reply other threads:[~2010-04-08 15:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-08 14:59 L'\0' handling Yura Pakhuchiy
2010-04-08 15:22 ` Michael Stefaniuc [this message]
2010-04-08 15:39 ` Yura Pakhuchiy
2010-04-08 15:54 ` Michael Stefaniuc
2010-04-08 20:19 ` Christopher Li
[not found] ` <1270758815.2167.13.camel@yura-tl>
2010-04-08 20:46 ` Christopher Li
2010-04-08 20:58 ` Michael Stefaniuc
2010-04-08 23:18 ` Christopher Li
2010-04-09 8:57 ` Michael Stefaniuc
2010-04-09 20:07 ` Christopher Li
2010-04-09 20:28 ` Michael Stefaniuc
2010-06-18 0:30 ` Christopher Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BBDF4C0.8020305@redhat.com \
--to=mstefani@redhat.com \
--cc=linux-sparse@vger.kernel.org \
--cc=pakhuchiy@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).