[dpdk-dev] [PATCH v3 00/11] Fix build errors related to exported headers

Adrien Mazarguil adrien.mazarguil at 6wind.com
Fri Jul 8 17:23:04 CEST 2016


On Fri, Jul 08, 2016 at 03:45:50PM +0100, Ferruh Yigit wrote:
> On 7/8/2016 3:35 PM, Adrien Mazarguil wrote:
> > On Fri, Jul 08, 2016 at 02:15:37PM +0000, Wiles, Keith wrote:
> >>
> >>> On Jul 8, 2016, at 4:56 AM, Yigit, Ferruh <ferruh.yigit at intel.com> wrote:
> >>>
> >>> On 7/8/2016 9:05 AM, Adrien Mazarguil wrote:
> >>>> On Thu, Jul 07, 2016 at 06:33:17PM +0000, Wiles, Keith wrote:
> >>>>>
> >>>>>> On Jul 7, 2016, at 10:49 AM, Adrien Mazarguil <adrien.mazarguil at 6wind.com> wrote:
> >>>>>>
> >>>>>> DPDK uses GNU C language extensions in most of its code base. This is fine
> >>>>>> for internal source files whose compilation flags are controlled by DPDK,
> >>>>>> however user applications that use exported "public" headers may experience
> >>>>>> compilation failures when enabling strict error/standard checks (-std and
> >>>>>> -pedantic for instance).
> >>>>>
> >>>>> Do you try compiling these changes with CLANG and/or ICC compilers?
> >>>>
> >>>> clang/clang++ yes, works fine. I did not try with ICC however.
> >>>
> >>> I tested with icc, getting following error [1], compiler warning seems
> >>> valid, but didn't investigate what in your patch cause this.
> >>>
> >>> [1]
> >>> .../app/test/test_table_acl.c(487): error #2405: array of elements
> >>> containing a flexible array member is nonstandard
> >>>                struct rte_pipeline_table_entry entries[5];
> >>>                                                ^
> >>>
> >>> .../app/test/test_table_acl.c(492): error #2405: array of elements
> >>> containing a flexible array member is nonstandard
> >>>                struct rte_pipeline_table_entry entries_ptr[5];
> >>
> >> I am guessing it does not like the uint8_t action_data[0] in the rte_pipeline_table_entry structure. I can see why it would be non-standard allocated on the stack in this case. Maybe a keyword like __extension__ needs to be added or pragma.
> > 
> > Hmmm, right, a variable array cannot be embedded like that. I think a change
> > in test_table_acl.c would be better.
> Correct, I just wonder why not getting this same compiler warning before
> your changes.
> 
> ...

I guess declaring a zero-sized array does not give the same compiler
constraints as declaring a variable-sized one even though the structure has
the same size in both cases. C99 does not allow it. This is probably the
only difference.

> 
> > Is that the only issue you saw?
> > 
> Yes.

OK then, prepare for v4.

> >>>> Note that considering "({ ... })" is a GNU extension, compilers that do
> >>>> support this syntax also support the GNU __extension__ keyword. As a result,
> >>>> those that do not support this keyword most likely already cannot compile
> >>>> DPDK at all.

-- 
Adrien Mazarguil
6WIND


More information about the dev mailing list