Opened 9 years ago

Closed 8 years ago

#4263 closed defect (wontfix)

libavutil compile error

Reported by: Jon Owned by:
Priority: minor Component: avutil
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Elon Musk)

Summary of the bug:

CC libavutil/cpu.o
CC libavutil/crc.o
CC libavutil/des.o
CC libavutil/dict.o
CC libavutil/display.o
CC libavutil/downmix_info.o
CC libavutil/error.o
libavutil/error.c: In function `av_strerror':
libavutil/error.c:79:15: error: wrong type argument to unary minus
make: * [libavutil/error.o] Error 1

How to reproduce:

Just compile
# gcc --version
gcc (GCC) 4.6.2
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# uname -a
Linux localhost.localdomain 3.2.2 #12 SMP Wed Oct 24 11:00:28 UTC 2012 i686 i686 i386 GNU/Linux

Version is 2.5.3, this is missing from the version Pulldown ?

Attachments (3)

config.log (249.7 KB ) - added by Jon 9 years ago.
This time from ffmpeg-2.6.2
man_strerr (2.8 KB ) - added by Jon 9 years ago.
Manual text
string.h (13.9 KB ) - added by Jon 9 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by mastered, 9 years ago

It seems you get gnu version of strerror_r

Try to add to libavutil/error.c:
#define _POSIX_C_SOURCE 200112

So you get:
#undef _GNU_SOURCE
#define _POSIX_C_SOURCE 200112
#define _XOPEN_SOURCE 600 /* XSI-compliant version of strerror_r */

comment:2 by Michael Niedermayer, 9 years ago

missing configure line, information about your platform, config.mak/h/log

comment:3 by Jon, 9 years ago

I am trying again with newer ffmpeg. Still the same

CC libavutil/error.o
libavutil/error.c: In function ‘av_strerror’:
libavutil/error.c:83:15: error: wrong type argument to unary minus
make: * [libavutil/error.o] Error 1

Modifying libavutil/error.c to read :

#undef _GNU_SOURCE
#define _XOPEN_SOURCE 600 /* XSI-compliant version of strerror_r */
#define _POSIX_C_SOURCE 200112
#include "avutil.h"

Does not fix it.

Any ideas ?

Thanks

by Jon, 9 years ago

Attachment: config.log added

This time from ffmpeg-2.6.2

comment:4 by Carl Eugen Hoyos, 9 years ago

Please tell us more about your system (which distribution?) and attach your /usr/include/string.h file. The output of man 3 strerror_r may also be interesting.

by Jon, 9 years ago

Attachment: man_strerr added

Manual text

by Jon, 9 years ago

Attachment: string.h added

comment:5 by Jon, 9 years ago

The system is custom. It started life as a Debian about 12 years ago but has largely been replaced by packages built from source.

comment:6 by Carl Eugen Hoyos, 9 years ago

It seems to me that your manual and your header disagree about the type of the strerror_r() function, indicating a broken system. Note that your header is from 2002...

comment:7 by Carl Eugen Hoyos, 9 years ago

Either send a configure patch to test for broken string.h header or just force HAVE_STRERROR_R to 0 in config.h after running configure.

comment:8 by Carl Eugen Hoyos, 9 years ago

Priority: normalminor
Status: newopen
Version: unspecifiedgit-master

in reply to:  5 comment:9 by Hendrik, 9 years ago

Replying to jonshouse:

The system is custom. It started life as a Debian about 12 years ago but has largely been replaced by packages built from source.

I suggest you fix your system then, it doesn't seem to be POSIX compliant.

comment:10 by Elon Musk, 8 years ago

Description: modified (diff)
Resolution: wontfix
Status: openclosed
Note: See TracTickets for help on using tickets.