[vlc-devel] Can not declare variably modified type at file scope

Måns Rullgård mans at mansr.com
Sat Jan 30 20:39:37 CET 2010


"Rémi Denis-Courmont" <remi at remlab.net> writes:

> Le samedi 30 janvier 2010 21:01:14 Francois Cartegnie, vous avez écrit :
>> VOUT_MAX_SUBPICTURES value is not defined locally. [1][2]
>
> As far as I know VOUT_MAX_SUBPICTURES is expanded to:
> ((16) > (((mtime_t)(0.5*1000000LL)))) ? (16) : (((mtime_t)(0.5*1000000LL)))
> which seems to me like a valid integer constant expression as defined by
> ISO/IEC 9899:1999 Technical Corrigendum 3 §6.6. Is it not?

No.  This is the relevant paragraph:

  An integer constant expression shall have integer type and shall
  only have operands that are integer constants, enumeration
  constants, character constants, sizeof expressions whose results are
  integer constants, and floating constants that are the immediate
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  operands of casts. Cast operators in an integer constant expression
  ^^^^^^^^^^^^^^^^^
  shall only convert arithmetic types to integer types, except as part
  of an operand to the sizeof operator.

The multiplication by 0.5 is not allowed.

-- 
Måns Rullgård
mans at mansr.com




More information about the vlc-devel mailing list