[FFmpeg-devel] [RFC UNTESTED PATCH] Add IA-64 assembly byteswapping functions.

Måns Rullgård mans
Fri Oct 24 14:00:03 CEST 2008

Diego Biurrun wrote:
> On Thu, Oct 23, 2008 at 05:40:36PM -0700, Eli Friedman wrote:
>> On Thu, Oct 23, 2008 at 12:37 AM, Diego Biurrun <diego at biurrun.de> wrote:
>> >> +static av_always_inline av_const uint16_t bswap_16(uint16_t x)
>> >> +{
>> >> +    uint16_t __v;
>> >
>> > This is an illegal variable name, names starting with __ are reserved
>> > for the system.  Please educate the glib guys about this.
>> This code is originally from the system header byteswap.h.  glibc
>> can't use any unreserved identifiers there because they could be
>> redefined.
> How does this apply to local variables in functions?  More so if it is

The standards do not mention anything about local variables made globally
visible like that.

> just called plain 'v'?  Do you think glib has to protect itself from
> #define v w

An inline function defines a new scope for its arguments and local variables,
so the situation is a bit better than for macros.  There is still the risk
that some symbol used locally has been #defined to something that isn't a
valid identifier, e.g. a number.  The convention of using uppercase for
non-function-like macros takes care of avoiding most such conflicts.

> ?  Not that many programs will compile with that textual substitution in
> place...

Never underestimate the "creativity" of a glib user.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list