Opened 13 years ago

Closed 13 years ago

#769 closed defect (fixed)

compile of mpcommon.c and command.c fails with conflicting types

Reported by: mplayer-bugs@… Owned by: reimar
Priority: normal Component: core
Version: HEAD Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:


With latest SVN (nut: 279, x264: 624, mplayer: 22417, ffmpeg: 8197) compile fails at mpcommon.c and command.c with conflicting types for fseeko and ftello in stdio.h:

cc -O4 -march=pentium4 -mcpu=pentium4 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I/usr/local/src/mplayer/SVN/nut/libnut -I/usr/local/src/mplayer/SVN/x264 -I/usr/X11R6/include -I/usr/include/SDL -D_REENTRANT -I/usr/include/artsc -I/usr/include -I/usr/include/dvdnav -I/usr/include/freetype2 -I/usr/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -I./libavutil -I./libavcodec -c -o mpcommon.o mpcommon.c
cc1: warning: changing search order for system directory "/usr/include"
cc1: warning: as it has already been specified as a non-system directory
In file included from subreader.h:4,

from libvo/sub.h:60,
from mpcommon.c:6:

/usr/include/stdio.h:506: conflicting types for `fseeko'
/usr/include/stdio.h:476: previous declaration of `fseeko'
/usr/include/stdio.h:507: conflicting types for `ftello'
/usr/include/stdio.h:478: previous declaration of `ftello'

This is with Linux 2.4.19, glibc 2.2.5 and gcc 3.2. Somehow these lines from stdio.h (1):

extern int fseek (FILE *stream, long int off, int whence) THROW;
extern long int ftell (FILE *stream) THROW;

get converted into

extern int fseeko (FILE *stream, long int off, int whence) ;
extern long int ftello (FILE *
stream) ;

(Output generated by -E option to cc, otherwise identical options as above).

Those lines are then followed by

extern int fseeko (FILE *stream, off64_t off, int whence) asm ("" "fseeko64");
extern off64_t ftello (FILE *stream) asm ("" "ftello64");

which obviously is a differing declaration. Removing -D_FILE_OFFSET_BITS=64 from the compile options compiles the files, but mplayer crashes with SIGSEGV as soon as it tries to read a subtitle (no surprise here...)
Commenting the lines (1) in stdio.h also compiles the files and mplayer runs without crashing.

As the compile options are identical for all source files of the project and several others include stdio.h and use fseek/ftell, I suspect the problem with mpcommon.c/command.c or libvo/sub.h or subreader.h.

Fell free to contact me if/when you need more information.

Change History (1)

comment:1 Changed 13 years ago by mplayer-bugs@…

  • Resolution set to fixed
  • Status changed from new to closed

(In reply to comment #0)
Just want to report that recent versions (nut: 282, x264: 650, mplayer: 22987, ffmpeg: 8727) compile without this problem, unfortunately I can't pinpoint the chagnes that did this.

Note: See TracTickets for help on using tickets.