[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#841316: gcc: the last 6.2.0-7 broke the virtualbox build


On Wed, 19 Oct 2016 14:47:48 +0000 (UTC) Gianfranco Costamagna
<locutusofborg@debian.org> wrote:
> Source: gcc
> Version: 6.2.0-7
> Severity: serious
> As said, I built virtualbox correctly with 6.2.0-6 and then uploaded on unstable.
> The new gcc 6.2.0-7 broke the build with the following error:
> /usr/include/x86_64-linux-gnu/sys/inotify.h:34:13: error: flexible array member 'inotify_event::name' not at end of 'struct InotifyEventWithName'

Relevant parts:

# define __flexarr      []

/* Structure describing an inotify event.  */
struct inotify_event
  int wd;               /* Watch descriptor.  */
  uint32_t mask;        /* Watch mask.  */
  uint32_t cookie;      /* Cookie to synchronize two events.  */
  uint32_t len;         /* Length (including NULs) of name.  */
  char name __flexarr;  /* Name.  */

struct InotifyEventWithName
    struct inotify_event e;
    char name[NAME_MAX];

While I do not know if this is a GCC bug or not, doing the above is a
bit dodgy (and prohibited by C99). What is the offset of
InotifyEventWithName::name supposed to be (given sizeof(inotify_event)
is undefined)?

This report has some info about GCC 6 changes in this regard:

Since it's closed as WONTFIX, I expect this will not be changed in gcc.


Attachment: signature.asc
Description: OpenPGP digital signature

Reply to: