[MPlayer-dev-eng] [PATCH] Fix building with Clang

Brad Smith brad at comstyle.com
Thu Dec 23 16:57:53 EET 2021


On 12/20/2021 10:47 AM, Reimar Döffinger wrote:

>
>> On 10 Dec 2021, at 07:48, Brad Smith <brad at comstyle.com> wrote:
>>
>> Fix building with Clang.
>>
>>
>> ./stream/stream.h:322:46: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
>>   mp_dbg(MSGT_DEMUX, MSGL_DBG3, "seek to 0x%"PRIX64"\n", pos);
>>                                              ^
>>
>> ./stream/stream.h:326:49: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
>>            "Invalid seek to negative position %"PRIx64"!\n", pos);
> Sorry for the late reply, but I think this needs a bit more details/explanation.
> 1) I’ve quickly tested on macOS which uses clang and it has no issues, so this can’t be a problem with clang in general I think?
> 2) MPlayer is not C++11, in fact it is not C++ at all, so this messages does not really make sense. Sure it’s not a bug in clang, or maybe you used clang++ instead of clang as compiler?
>
> Now the change is not a big deal, it’s just that I am not a big fan of working around issues that are not properly understood, also because if it’s a real issue the commit message should make it clear how we can avoid re-introducing such issues in the future.

1) Looks like you're not building with Live555 support.

2) Although almost all of MPlayer is C code there are two files in the 
tree that are C++ code.

./libmpdemux/demux_rtp_codec.cpp
./libmpdemux/demux_rtp.cpp

cc -MMD -MP -D_ISOC99_SOURCE -I. -Iffmpeg -O2 -pipe -ffast-math 
-fno-asynchronous-unwind-tables -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS 
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/usr/local/include -DPIC 
-D_THREAD_SAFE -I/usr/X11R6/include -I/usr/local/include 
-I/usr/X11R6/include/freetype2 -DZLIB_CONST -I/usr/local/include/bs2b 
-I/usr/local/include -I/usr/local/include -I/usr/local/include 
-I/usr/local/live/liveMedia/include 
-I/usr/local/live/UsageEnvironment/include 
-I/usr/local/live/BasicUsageEnvironment/include 
-I/usr/local/live/groupsock/include -c -o libmpdemux/demux_rtp.o 
libmpdemux/demux_rtp.cpp
In file included from libmpdemux/demux_rtp.cpp:30:
In file included from libmpdemux/demuxer.h:27:
./stream/stream.h:322:46: error: invalid suffix on literal; C++11 
requires a space between literal and identifier 
[-Wreserved-user-defined-literal]
   mp_dbg(MSGT_DEMUX, MSGL_DBG3, "seek to 0x%"PRIX64"\n", pos);
                                              ^

./stream/stream.h:326:49: error: invalid suffix on literal; C++11 
requires a space between literal and identifier 
[-Wreserved-user-defined-literal]
            "Invalid seek to negative position %"PRIx64"!\n", pos);
                                                 ^




More information about the MPlayer-dev-eng mailing list