[FFmpeg-devel] C99 or GCC extensions

Axel Holzinger aholzinger
Fri Jul 11 18:40:43 CEST 2008


Hi again,

Axel Holzinger <aholzinger at gmx.de> writes:
> "M?ns Rullg?rd" <mans at mansr.com> writes:
> 
> > ...
> >
> > It is almost certainly remnants of days gone by, when rules
> were
> > less strict.
> >
> > > If not, what is the current policy on this and are patches
> > > welcome to remove GCC specifics in favour of C99?
> >
> > The current policy is that new code should compile with a C99
> > compiler, unless it is an optional assembler optimisation.
> > Patches to rectify non-standard code are always welcome.
> 
> Great, lavori in corso.

I looked a bit at statements in expressions, which are not C99
AFAIK and I found an issue with the FASTDIV implementation in
internal.h of libavutil.

The FASTDIV macro uses statements in an expression. The only way
to come around this I can see with C99 is to move the code in an
inlined function.

To enter the discussion on how to fix this correctly I made a
patch which implements a function named FASTDIV, which is not
entirely political correct as capital names normally shouldn't
be used for functions. OTOH I didn't want to completely change
the structure.

It would also be possible to always implement the function and
inside #ifdef the different architectures. I don't hold stock
options in any of the possibilities, I'm just interested in
C99 "conformizing" the code :-)

Take care
Axel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fastdiv_internal_h.diff
Type: application/octet-stream
Size: 1323 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080711/d1bdc2df/attachment.obj>



More information about the ffmpeg-devel mailing list