All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brown <david@westcontrol.com>
To: linux-raid@vger.kernel.org
Subject: Re: [PATCH 1/1] Work around gcc-4.7's strict aliasing checks
Date: Tue, 24 Jan 2012 10:18:57 +0100	[thread overview]
Message-ID: <jflta6$vnr$1@dough.gmane.org> (raw)
In-Reply-To: <4F1E027A.40007@ziu.info>

On 24/01/2012 01:59, Michal Soltys wrote:
>
> Well, IMHO the [probably] best workaround for now would be
> -fno-strict-aliasing then - which avoids warnings, ugly attribute
> [over]use, and should assure expected behavior.
>
> Say, near the top of Makefile:
>
> -CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(DIRFLAGS)
> +CFLAGS = $(CWFLAGS) $(CXFLAGS) -fno-strict-aliasing -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(DIRFLAGS)

Another option is using #pragma's in the source code to turn on 
"no-strict-aliasing" - I don't know what the preferences are on #pragma 
versus Makefile options.  Personally, I prefer a #pragma in a case like 
this, as it ties the option closer to the code that requires it - but 
obviously the Linux code style preferences must be followed.



      reply	other threads:[~2012-01-24  9:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05 11:16 [PATCH 0/1] gcc-4.7 build fix Jes.Sorensen
2012-01-05 11:16 ` [PATCH 1/1] Work around gcc-4.7's strict aliasing checks Jes.Sorensen
2012-01-11 23:43   ` NeilBrown
2012-01-12  7:14     ` David Brown
2012-01-12 13:45       ` Michal Soltys
2012-01-13 12:20         ` David Brown
2012-01-13 14:21           ` Michal Soltys
2012-01-13 17:48             ` David Brown
2012-01-12  9:24     ` Jes Sorensen
2012-01-22  0:49     ` Michal Soltys
2012-01-22  0:49       ` [PATCH] compile cleanly with -Wstrict-aliasing=1 Michal Soltys
2012-01-23 12:50       ` [PATCH 1/1] Work around gcc-4.7's strict aliasing checks Jes Sorensen
2012-01-24  0:59         ` Michal Soltys
2012-01-24  9:18           ` David Brown [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='jflta6$vnr$1@dough.gmane.org' \
    --to=david@westcontrol.com \
    --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 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.