Message ID | CACtJ1JQ8UYkQr4Js0hLDyQAs1N2SH9GE0pJaUjaoOsBnm8U8BQ@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>> On 26.09.17 at 01:08, <bhupinder.thakur@linaro.org> wrote: > Yes, after including the __STRICT_ANSI__ check the headers.chk check > passes. But I had to include string header file (after suggestion from > Stefano) for fixing the headers++.chk. I'd like to have a more detailed explanation here - since the header passed the check without this prereq before, I'd prefer if the dependency was not added unconditionally. > --- a/xen/include/public/io/console.h > +++ b/xen/include/public/io/console.h > @@ -40,7 +40,9 @@ struct xencons_interface { > XENCONS_RING_IDX out_cons, out_prod; > }; > > +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) > DEFINE_XEN_FLEX_RING(xencons); > +#endif At the first glance it also looks as if the scope of this conditional was too narrow. Jan
Hi Jan, On 26 September 2017 at 12:45, Jan Beulich <JBeulich@suse.com> wrote: >>>> On 26.09.17 at 01:08, <bhupinder.thakur@linaro.org> wrote: >> Yes, after including the __STRICT_ANSI__ check the headers.chk check >> passes. But I had to include string header file (after suggestion from >> Stefano) for fixing the headers++.chk. > > I'd like to have a more detailed explanation here - since the header > passed the check without this prereq before, I'd prefer if the > dependency was not added unconditionally. The C header passed the check without the prereq addition. However, for C++ headers since __STRICT_ANSI__ is not defined, it tries to expand the DEFINE_XEN_FLEX_RING macro and looks for declarations for size_t, memcpy() etc. To satisfy that requirement, string header file had to included similar to what was done for pvcalls. > >> --- a/xen/include/public/io/console.h >> +++ b/xen/include/public/io/console.h >> @@ -40,7 +40,9 @@ struct xencons_interface { >> XENCONS_RING_IDX out_cons, out_prod; >> }; >> >> +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) >> DEFINE_XEN_FLEX_RING(xencons); >> +#endif > > At the first glance it also looks as if the scope of this conditional > was too narrow. Do you mean that xencons_interface should also be under ifdef? Regards, Bhupinder
>>> On 26.09.17 at 10:16, <bhupinder.thakur@linaro.org> wrote: > On 26 September 2017 at 12:45, Jan Beulich <JBeulich@suse.com> wrote: >>>>> On 26.09.17 at 01:08, <bhupinder.thakur@linaro.org> wrote: >>> Yes, after including the __STRICT_ANSI__ check the headers.chk check >>> passes. But I had to include string header file (after suggestion from >>> Stefano) for fixing the headers++.chk. >> >> I'd like to have a more detailed explanation here - since the header >> passed the check without this prereq before, I'd prefer if the >> dependency was not added unconditionally. > > The C header passed the check without the prereq addition. However, > for C++ headers since > __STRICT_ANSI__ is not defined, it tries to expand the > DEFINE_XEN_FLEX_RING macro > and looks for declarations for size_t, memcpy() etc. To satisfy that > requirement, string header > file had to included similar to what was done for pvcalls. Ah, yes. This should equally apply to the C99 check then. Jan
diff --git a/xen/include/Makefile b/xen/include/Makefile index 1299b19..c90fdee 100644 --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -98,6 +98,7 @@ PUBLIC_C99_HEADERS := public/io/9pfs.h public/io/pvcalls.h PUBLIC_ANSI_HEADERS := $(filter-out public/%ctl.h public/xsm/% public/%hvm/save.h $(PUBLIC_C99_HEADERS), $(PUBLIC_HEADERS)) public/io/9pfs.h-prereq := string +public/io/console.h-prereq := string public/io/pvcalls.h-prereq := string headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile diff --git a/xen/include/public/io/console.h b/xen/include/public/io/console.h index 5e45e1c..0f0711f 100644 --- a/xen/include/public/io/console.h +++ b/xen/include/public/io/console.h @@ -40,7 +40,9 @@ struct xencons_interface { XENCONS_RING_IDX out_cons, out_prod; }; +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) DEFINE_XEN_FLEX_RING(xencons); +#endif #endif /* __XEN_PUBLIC_IO_CONSOLE_H__ */