From: Christopher Li <sparse@chrisli.org>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Sparse Mailing-list <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH 2/3] Makefile: Fix some macro redefinition warnings
Date: Fri, 17 May 2013 11:30:10 -0700 [thread overview]
Message-ID: <51967732.40302@chrisli.org> (raw)
In-Reply-To: <519536B5.7020603@ramsay1.demon.co.uk>
On 05/16/2013 12:42 PM, Ramsay Jones wrote:
>
> In particular, gcc complains as follows:
>
> CC sparse-llvm.o
> <command line>:1:1: warning: "__STDC_CONSTANT_MACROS" redefined
> <command line>:1:1: warning: this is the location of the previous definition
> <command line>:1:1: warning: "__STDC_FORMAT_MACROS" redefined
> <command line>:1:1: warning: this is the location of the previous definition
> <command line>:1:1: warning: "__STDC_LIMIT_MACROS" redefined
> <command line>:1:1: warning: this is the location of the previous definition
>
> The warnings are caused by the macros being defined twice on the
> gcc command line. These command line -D macro definitions come
> originally from the output of 'llvm-config --cflags', which is
> recorded in the $(LLVM_CFLAGS) variable. This variable is then
> included in the $(BASIC_CFLAGS) variable twice due to duplication
> of the target-specific additions to the BASIC_CFLAGS, viz:
>
> sparse-llvm_EXTRA_DEPS := sparse-llvm.o
> sparse-llvm.o $(sparse-llvm_EXTRA_DEPS): BASIC_CFLAGS += $(LLVM_CFLAGS)
>
> In order to suppress the warnings, we remove the duplication of
> the sparse-llvm.o target in the above rule.
>
> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
I already commit a similar fix to remove the duplication.
I did not realize it can generate warning though.
Chris
prev parent reply other threads:[~2013-05-17 18:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-16 19:42 [PATCH 2/3] Makefile: Fix some macro redefinition warnings Ramsay Jones
2013-05-17 18:30 ` Christopher Li [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=51967732.40302@chrisli.org \
--to=sparse@chrisli.org \
--cc=linux-sparse@vger.kernel.org \
--cc=ramsay@ramsay1.demon.co.uk \
/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).