From: Julien Grall <julien.grall@linaro.org>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: xen-devel@lists.xensource.com, Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCH v2] libxc: Fix buffer length for get_suspend_file
Date: Tue, 18 Mar 2014 14:00:52 +0000 [thread overview]
Message-ID: <53285194.907@linaro.org> (raw)
In-Reply-To: <1395151088-9724-1-git-send-email-ian.jackson@eu.citrix.com>
Hi Ian,
On 03/18/2014 01:58 PM, Ian Jackson wrote:
> Declaring a formal parameter to have an array type doesn't result in
> the parameter actually having an array type. The type is "adjusted"
> to a pointer. (C99 6.9.1(7), 6.7.5.3.)
>
> So the use of sizeof in xc_suspend.c:get_suspend_file was wrong.
> Instead, use the #define. Also get rid of the array size, as it is
> misleading.
>
> Newer versions of gcc warn about the erroneous code:
> xc_suspend.c:39:25: error: argument to 'sizeof' in 'snprintf' call
> is the same expression as the destination; did you mean to provide
> an explicit length? [-Werror=sizeof-pointer-memaccess]
>
> Reported-By: Julien Grall <julien.grall@linaro.org>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> CC: Ian Campbell <ian.campbell@citrix.com>
> CC: Julien Grall <julien.grall@linaro.org>
Great, I'm able to compile libxc with gcc 4.8:
Tested-by: Julien Grall <julien.grall@linaro.org>
Regards,
--
Julien Grall
prev parent reply other threads:[~2014-03-18 14:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 13:54 [PATCH] libxc: Fix buffer length for get_suspend_file Ian Jackson
2014-03-18 13:56 ` Ian Campbell
2014-03-18 13:58 ` Ian Jackson
2014-03-18 13:58 ` [PATCH v2] " Ian Jackson
2014-03-18 14:00 ` Ian Campbell
2014-03-18 14:10 ` Ian Jackson
2014-03-18 14:00 ` Julien Grall [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=53285194.907@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=xen-devel@lists.xensource.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 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.