* [PATCH for-4.9] xen: append -Wno-unused-function to C99 header check
@ 2017-04-06 12:54 Wei Liu
2017-04-06 14:33 ` Jan Beulich
0 siblings, 1 reply; 4+ messages in thread
From: Wei Liu @ 2017-04-06 12:54 UTC (permalink / raw)
To: Xen-devel
Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
Ian Jackson, Tim Deegan, Julien Grall, Jan Beulich
The check builds header file as if it is a C file. Clang doesn't like
the idea of having dead code in C file. The check as-is fails on Clang
with unused function warnings.
We know for sure we don't care about those unused function warnings.
Just ignore them.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
xen/include/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 65a732a707..b0bacc99b5 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -111,7 +111,7 @@ headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile
headers99.chk: $(PUBLIC_C99_HEADERS) Makefile
rm -f $@.new
$(foreach i, $(filter %.h,$^), \
- $(CC) -x c -std=c99 -Wall -Werror \
+ $(CC) -x c -std=c99 -Wall -Werror -Wno-unused-function \
-include stdint.h $(foreach j, $($(i)-prereq), -include $(j).h) \
-S -o /dev/null $(i) \
|| exit $$?; echo $(i) >> $@.new;)
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH for-4.9] xen: append -Wno-unused-function to C99 header check
2017-04-06 12:54 [PATCH for-4.9] xen: append -Wno-unused-function to C99 header check Wei Liu
@ 2017-04-06 14:33 ` Jan Beulich
2017-04-06 16:51 ` Stefano Stabellini
0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2017-04-06 14:33 UTC (permalink / raw)
To: Wei Liu
Cc: Stefano Stabellini, George Dunlap, AndrewCooper, Ian Jackson,
Tim Deegan, Julien Grall, Xen-devel
>>> On 06.04.17 at 14:54, <wei.liu2@citrix.com> wrote:
> --- a/xen/include/Makefile
> +++ b/xen/include/Makefile
> @@ -111,7 +111,7 @@ headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile
> headers99.chk: $(PUBLIC_C99_HEADERS) Makefile
> rm -f $@.new
> $(foreach i, $(filter %.h,$^), \
> - $(CC) -x c -std=c99 -Wall -Werror \
> + $(CC) -x c -std=c99 -Wall -Werror -Wno-unused-function \
> -include stdint.h $(foreach j, $($(i)-prereq), -include $(j).h) \
> -S -o /dev/null $(i) \
> || exit $$?; echo $(i) >> $@.new;)
I think it would be better to make this match the C++ check, where
a source file is being generated on the fly (and quite possibly for a
similar reason).
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH for-4.9] xen: append -Wno-unused-function to C99 header check
2017-04-06 14:33 ` Jan Beulich
@ 2017-04-06 16:51 ` Stefano Stabellini
2017-04-06 17:53 ` Wei Liu
0 siblings, 1 reply; 4+ messages in thread
From: Stefano Stabellini @ 2017-04-06 16:51 UTC (permalink / raw)
To: Jan Beulich
Cc: Stefano Stabellini, Wei Liu, George Dunlap, AndrewCooper,
Ian Jackson, Tim Deegan, Julien Grall, Xen-devel
On Thu, 6 Apr 2017, Jan Beulich wrote:
> >>> On 06.04.17 at 14:54, <wei.liu2@citrix.com> wrote:
> > --- a/xen/include/Makefile
> > +++ b/xen/include/Makefile
> > @@ -111,7 +111,7 @@ headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile
> > headers99.chk: $(PUBLIC_C99_HEADERS) Makefile
> > rm -f $@.new
> > $(foreach i, $(filter %.h,$^), \
> > - $(CC) -x c -std=c99 -Wall -Werror \
> > + $(CC) -x c -std=c99 -Wall -Werror -Wno-unused-function \
> > -include stdint.h $(foreach j, $($(i)-prereq), -include $(j).h) \
> > -S -o /dev/null $(i) \
> > || exit $$?; echo $(i) >> $@.new;)
>
> I think it would be better to make this match the C++ check, where
> a source file is being generated on the fly (and quite possibly for a
> similar reason).
I don't have an opinion on what is the best way to fix this. However,
I'll say that it is expected to have unused functions in header files
(it would be a problem if there weren't), so -Wno-unused-function looks
fine to me.
Wei, given that the problem was introduced by my patch, let me know if
you need any help fixing this.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH for-4.9] xen: append -Wno-unused-function to C99 header check
2017-04-06 16:51 ` Stefano Stabellini
@ 2017-04-06 17:53 ` Wei Liu
0 siblings, 0 replies; 4+ messages in thread
From: Wei Liu @ 2017-04-06 17:53 UTC (permalink / raw)
To: Stefano Stabellini
Cc: Wei Liu, George Dunlap, AndrewCooper, Ian Jackson, Tim Deegan,
Julien Grall, Jan Beulich, Xen-devel
On Thu, Apr 06, 2017 at 09:51:32AM -0700, Stefano Stabellini wrote:
> On Thu, 6 Apr 2017, Jan Beulich wrote:
> > >>> On 06.04.17 at 14:54, <wei.liu2@citrix.com> wrote:
> > > --- a/xen/include/Makefile
> > > +++ b/xen/include/Makefile
> > > @@ -111,7 +111,7 @@ headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile
> > > headers99.chk: $(PUBLIC_C99_HEADERS) Makefile
> > > rm -f $@.new
> > > $(foreach i, $(filter %.h,$^), \
> > > - $(CC) -x c -std=c99 -Wall -Werror \
> > > + $(CC) -x c -std=c99 -Wall -Werror -Wno-unused-function \
> > > -include stdint.h $(foreach j, $($(i)-prereq), -include $(j).h) \
> > > -S -o /dev/null $(i) \
> > > || exit $$?; echo $(i) >> $@.new;)
> >
> > I think it would be better to make this match the C++ check, where
> > a source file is being generated on the fly (and quite possibly for a
> > similar reason).
>
> I don't have an opinion on what is the best way to fix this. However,
> I'll say that it is expected to have unused functions in header files
> (it would be a problem if there weren't), so -Wno-unused-function looks
> fine to me.
>
> Wei, given that the problem was introduced by my patch, let me know if
> you need any help fixing this.
>
No need. I have another patch queued up for posting -- waiting for
report from travis.
Wei.
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-06 17:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 12:54 [PATCH for-4.9] xen: append -Wno-unused-function to C99 header check Wei Liu
2017-04-06 14:33 ` Jan Beulich
2017-04-06 16:51 ` Stefano Stabellini
2017-04-06 17:53 ` Wei Liu
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.