[Libav-user] g++ 4.7.2 fails to compile av_err2str

Alex Cohn alexcohn at netvision.net.il
Mon Jan 14 11:42:32 CET 2013

On Mon, Jan 14, 2013 at 12:20 PM, "René J.V. Bertin"
<rjvbertin at gmail.com> wrote:
> On Jan 14, 2013, at 11:01, Wang Bin wrote:
>> > g++ 4.7.2 fails to compile av_err2strI use av_err2str
>> > in a c++ file, g++ 4.7.2 can not compile it. The error
>> > message is "taking address of temporary array".
> That's a surprising error for me ... the only physical explanation for a
> variable not having an address is when it is assigned to a register IMHO ...
> and the compiler is not supposed to do that when the variable's address is
> used later on. Semantics imposed by C++?
> R.

An easy test proves that adding "-x c" to command line resolves the
problem. So it is a C++ artifact.

Alex Cohn

More information about the Libav-user mailing list