Re: [PATCH v3] Use fallthrough attribute

2018-02-09 Thread Frank Ch. Eigler
Hi - On Sat, Feb 10, 2018 at 03:26:43AM +0100, Mark Wielaard wrote: > I added ChangeLog entries and pushed it to master. What's a ChangeLog entry? :-) - FChE

Re: [PATCH v3] Use fallthrough attribute

2018-02-09 Thread Mark Wielaard
Hi Joshua, On Fri, Feb 09, 2018 at 10:27:18AM -0600, Joshua Watt wrote: > Use __attribute__ ((fallthrough)) to indicate switch case fall through > instead of a comment. This ensure that the fallthrough warning is not > triggered even if the file is pre-processed (hence stripping the > comments) be

[PATCH] libdw: Add support for DWARF5 DW_FORM_data16.

2018-02-09 Thread Mark Wielaard
The DWARF5 spec says DW_FORM_data16 is constant class (128bit value). But we treat it as if it is block class. So to use a attribute that is encoded as DW_FORM_data16 use dwarf_formblock, not dwarf_form[us]data. We cannot use dwarf_form[us]data since they return a Dwarf_Word/Sword, which are only

[PATCH] libdw: Handle DWARF5 DW_FORM_implicit_const. Add dwarf_getabbrevattr_data.

2018-02-09 Thread Mark Wielaard
Handle the new DW_FORM_implicit_const. The value of this form is embedded in the abbrev data (as sleb128) and not in the info DIE data. This also adds a new function dwarf_getabbrevattr_data which allows getting any data/value associated with a form. eu-readelf will use this new function to show th

[PATCH v3] Use fallthrough attribute

2018-02-09 Thread Joshua Watt
Use __attribute__ ((fallthrough)) to indicate switch case fall through instead of a comment. This ensure that the fallthrough warning is not triggered even if the file is pre-processed (hence stripping the comments) before it is compiled. The actual fallback implementation is hidden behind a FALLB

Re: [PATCH v2] Add fallthrough attributes

2018-02-09 Thread Joshua Watt
On Fri, 2018-02-09 at 10:26 +0100, Mark Wielaard wrote: > On Fri, Feb 09, 2018 at 10:08:09AM +0100, Ulf Hermann wrote: > > > [...] > > > +#ifdef HAVE_FALLTHROUGH > > > + __attribute__ ((fallthrough)); > > > +#endif > > > [...] > > > > I would like to see this stanza wrapped in a macro, so tha

Re: [PATCH v2] Add fallthrough attributes

2018-02-09 Thread Mark Wielaard
On Fri, Feb 09, 2018 at 10:08:09AM +0100, Ulf Hermann wrote: > > [...] > > +#ifdef HAVE_FALLTHROUGH > > + __attribute__ ((fallthrough)); > > +#endif > > [...] > > I would like to see this stanza wrapped in a macro, so that we only have one > "#ifdef HAVE_FALLTHROUGH" in the code, not another

Re: [PATCH v2] Add fallthrough attributes

2018-02-09 Thread Ulf Hermann
> [...] > +#ifdef HAVE_FALLTHROUGH > + __attribute__ ((fallthrough)); > +#endif > [...] I would like to see this stanza wrapped in a macro, so that we only have one "#ifdef HAVE_FALLTHROUGH" in the code, not another one in every place we want to fall through. See the "internal_function" mac