All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "mwilck@suse.com" <mwilck@suse.com>,
	"hare@suse.de" <hare@suse.de>,
	"christophe.varoqui@opensvc.com" <christophe.varoqui@opensvc.com>
Cc: "dm-devel@redhat.com" <dm-devel@redhat.com>
Subject: Re: [PATCH 2/2] multipath-tools: fix compilation with gcc < 4.9
Date: Wed, 17 May 2017 14:23:52 +0000	[thread overview]
Message-ID: <1495031031.2945.6.camel@sandisk.com> (raw)
In-Reply-To: <20170517135439.25935-3-mwilck@suse.com>

On Wed, 2017-05-17 at 15:54 +0200, Martin Wilck wrote:
> +# $(call TEST_CC_OPTION,option,fallback)
> +# Test if the C compiler supports the option.
> +# Evaluates to "option" if yes, and "fallback" otherwise.
> +TEST_CC_OPTION = $(shell \
> +	if $(CC) -o /dev/null -c "$(1)" -xc - <<<'int main(void){return 0;}' &>/dev/null; \
> +	then \
> +		echo "$(1)"; \
> +	else \
> +		echo "$(2)"; \
> +	fi)

Since '<<<' is nonstandard, please consider to use 'echo' and a pipe instead.
See also http://pubs.opengroup.org/onlinepubs/9699919799/.

> +STACKPROT = $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector)

Please consider to use ":=" instead of "=" such that TEST_CC_OPTION gets called
once per "make" invocation instead of once per C file that is built.

Thanks,

Bart.

      reply	other threads:[~2017-05-17 14:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 13:54 [PATCH 0/2] Small multipath fixes Martin Wilck
2017-05-17 13:54 ` [PATCH 1/2] libmultipath: print.c: make sure lines are 0-terminated Martin Wilck
2017-05-17 14:07   ` Johannes Thumshirn
2017-05-17 14:17   ` Bart Van Assche
2017-05-17 13:54 ` [PATCH 2/2] multipath-tools: fix compilation with gcc < 4.9 Martin Wilck
2017-05-17 14:23   ` Bart Van Assche [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=1495031031.2945.6.camel@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.de \
    --cc=mwilck@suse.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.