From: NeilBrown <neilb@suse.de>
To: Luca Berra <bluca@comedia.it>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] gcc warnings again
Date: Fri, 17 Jun 2011 14:42:04 +1000 [thread overview]
Message-ID: <20110617144204.28e651cb@notabene.brown> (raw)
In-Reply-To: <20110616070510.GA8544@maude.comedia.it>
On Thu, 16 Jun 2011 09:05:10 +0200 Luca Berra <bluca@comedia.it> wrote:
> hello.
> yesterday i tried rebuilding both mdadm 3.1.5 and 3.2.1 with gcc 4.6,
> with the following CXFLAGS
>
> x86: -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat
> -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
> --param=ssp-buffer-size=4 -fomit-frame-pointer -mtune=generic
> -march=i586 -fasynchronous-unwind-tables
>
> x86_64: -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat
> -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
> --param=ssp-buffer-size=4 -fPIC
>
> i found a good number of warnings
> unused but set variable
> strict aliasing
> comparison between signed and unsigned values *on 32bit*
>
> for the unused variables i found fedora already had a patch which is
> sensible enough, i did not see it reported here, so i will attach it.
>
> I know -Wstrict-aliasing=2 can give false positive but those looked real
> to me, so i fixed those.
>
> looking at the gpt code in util.c i found i did not like it at all, a
> gpt partition entry is currently 128 bytes, but the spec does not say it
> is a fixed value, so the code that reads into a buffer with 512bytes
> chunk expecting this to be a multiplier of part_size is imho incorrect.
> my fix was to read each partition entry directly into a struct
> GPT_part_entry, the advantage is that the code is very simple to read,
> the disadvantage it is 128 reads of 128 bytes each, which is
> sub-optimal, but i believe readahead will mitigate this a lot.
>
> regards,
> L.
>
>
Hi Luca,
thanks for these. I have applied them all, though I made a number of
changes to the first patch for fixing warning - nothing major.
They are just in time for 3.2.2 which is nice...
Thanks,
NeilBrown
prev parent reply other threads:[~2011-06-17 4:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-16 7:05 [PATCH] gcc warnings again Luca Berra
2011-06-17 4:42 ` NeilBrown [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=20110617144204.28e651cb@notabene.brown \
--to=neilb@suse.de \
--cc=bluca@comedia.it \
--cc=linux-raid@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 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).