From: Hans de Goede <hdegoede@redhat.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
Ismael Luceno <ismael.luceno@gmail.com>,
linux-media@vger.kernel.org
Subject: Re: [PATCH] gspca_gl860: Clean up idxdata structs
Date: Mon, 17 Mar 2014 20:20:58 +0100 [thread overview]
Message-ID: <53274B1A.3080906@redhat.com> (raw)
In-Reply-To: <5326F6D3.8010307@xs4all.nl>
Hi,
On 03/17/2014 02:21 PM, Hans Verkuil wrote:
> On 03/15/2014 11:08 AM, Hans de Goede wrote:
>> Hi,
>>
>> Some better commit msg would be nice, otherwise this patch is:
>>
>> Acked-by: Hans de Goede <hdegoede@redhat.com>
>>
>> Hans Verkuil has mailed me that he would like to pick this up through
>> his tree. Hans V. , I say go for it :)
>
> I noticed that these sparse warnings suddenly disappeared after switching to
> sparse-0.5.0. It turns out to be a sparse bug:
>
> commit 0edb7edecdd571c2663eb12acac1b27b9acac657
> Author: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
> Date: Thu May 16 20:41:24 2013 +0100
>
> char.c: Fix parsing of escapes
>
> When parsing a string or character constant, the parse_escape()
> function returns a pointer to the character at which to resume
> parsing. However, in the case of an hex or octal escape, it was
> returning a one-past-the-end pointer. Thus, a string like:
>
> char str[3] = "\x61\x62\x63";
>
> was being parsed as:
>
> '\x61', 'x', '6', '2', '\x63'
>
> which, in turn, provokes an 'too long initializer' warning.
>
> Also, fix an off-by-one error in get_char_constant() when setting
> the 'end' pointer for a TOKEN_CHAR or TOKEN_WIDE_CHAR. Despite the
> name, the string->length of the token is actually the size of the
> allocated memory (ie len+1), so we need to compensate by using
> 'token->string->length - 1'.
>
> That said, I think it is really ugly to use a string like that and I still
> would like to apply this patch, although for 3.16, not 3.15 as was my
> original intention.
>
> Hans, do you agree with that approach? Or do you prefer to keep it as is?
I agree that using strings for this is ugly, and I would still like to see
this patch go in. I've no preference for putting it in 3.15 or 3.16 .
Regards,
Hans
prev parent reply other threads:[~2014-03-17 19:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 19:43 [PATCH] gspca_gl860: Clean up idxdata structs Ismael Luceno
2014-03-15 10:08 ` Hans de Goede
2014-03-17 13:21 ` Hans Verkuil
2014-03-17 19:20 ` Hans de Goede [this message]
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=53274B1A.3080906@redhat.com \
--to=hdegoede@redhat.com \
--cc=hverkuil@xs4all.nl \
--cc=ismael.luceno@gmail.com \
--cc=linux-media@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.