[dvblast-devel] [PATCH] Fix bunch of warnings about GNU extension under clang.

Zoran Turalija zoran.turalija at gmail.com
Wed Apr 17 11:26:45 CEST 2013


On Wed, Apr 17, 2013 at 11:41:56AM +0300, Georgi Chorbadzhiyski wrote:
> On 4/17/13 10:40 AM, Zoran Turalija wrote:
> > Clang complaints are like:
> > ./dvblast.h:136:22: warning: field 'raw_pkt_header' with variable sized type
> >       'struct udprawpkt' not at the end of a struct or class is a GNU extension
> >       [-Wgnu]
> >     struct udprawpkt raw_pkt_header;
> >                      ^
> > ---
> >  dvblast.h |   16 ++++++++--------
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/dvblast.h b/dvblast.h
> > index eb7f9d3..89c94c0 100644
> > --- a/dvblast.h
> > +++ b/dvblast.h
> > @@ -127,14 +127,6 @@ typedef struct output_t
> >  {
> >      output_config_t config;
> >  
> > -    /* output */
> > -    int i_handle;
> > -    packet_t *p_packets, *p_last_packet;
> > -    struct udprawpkt raw_pkt_header;
> > -    uint16_t i_seqnum;
> > -    mtime_t i_ref_timestamp;
> > -    mtime_t i_ref_wallclock;
> > -
> >      /* demux */
> >      int i_nb_errors;
> >      mtime_t i_last_error;
> > @@ -157,6 +149,14 @@ typedef struct output_t
> >      /* For pidmap from config file */
> >      bool b_do_remap;
> >      uint16_t pi_confpids[N_MAP_PIDS];
> > +
> > +    /* output */
> > +    int i_handle;
> > +    packet_t *p_packets, *p_last_packet;
> > +    uint16_t i_seqnum;
> > +    mtime_t i_ref_timestamp;
> > +    mtime_t i_ref_wallclock;
> > +    struct udprawpkt raw_pkt_header;
> >  } output_t;
> >  
> >  typedef struct ts_pid_info {
> > 
> 
> Why don't you move just the struct? Moving other variables seems unnecessary.

The only reason to move all variables was to preserve logical separation of
variables intact (in this case, those that are members of "output" group).

But, I'm fine with moving only struct. That patch is in attach.

You choose one you prefer most.

-- 
Kind regards,
Zoran Turalija
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-bunch-of-warnings-about-GNU-extension-under-clan.patch
Type: text/x-diff
Size: 1149 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/dvblast-devel/attachments/20130417/18905c56/attachment.patch>


More information about the dvblast-devel mailing list