[FFmpeg-devel] volatile vs. __volatile vs. __volatile__

Måns Rullgård mans
Sat Feb 23 23:33:45 CET 2008


Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> writes:

> Hello,
> currently FFmpeg uses an random mess of __asm __volatile, __asm__
> __volatile__ and asm volatile.
> Of these, at least the __volatile part is not supported by the Sun C
> compiler (admittedly it is not really usable for FFmpeg right now anyway).
> Is there a chance to decide for one way?
> Since volatile is keyword I do not really see a point in the __, the asm
> case may be a bit different, though at most two ways to write it IMO
> should be more than enough there as well...
> Opinions?

GCC supports __ versions for its extended keywords (and those recently
added to the standard), and recognises these even when flags such as
-traditional disable the special meanings.  It does this so system
headers (and anyone else who pleases) can use them without breaking
compilation of legacy source code.

There is no reason for an application like FFmpeg, which uses these
words in their new keyword sense, to use the __ versions.

Why there are __ versions of volatile is a mystery, since it has been
a keyword since the beginning of time.

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




More information about the ffmpeg-devel mailing list