Bug #2306
Unable to compile on MacOSX 10.9
0%
Description
I am unable to compile the current src on a Mac Mini running Mavericks, obviously because of a bug in webui.c:
CC src/webui/webui.o
src/webui/webui.c:1227:5: error: format specifies type 'long long' but the argument has type 'intmax_t' (aka 'long') [-Werror,-Wformat]
file_start, file_end, st.st_size);
~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
builtin_sprintf_chk (str, 0, darwin_obsz(str), __VA_ARGS)
src/webui/webui.c:1227:17: error: format specifies type 'long long' but the argument has type 'intmax_t' (aka 'long') [-Werror,-Wformat]
file_start, file_end, st.st_size);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
builtin_sprintf_chk (str, 0, darwin_obsz(str), __VA_ARGS)
^
2 errors generated.
make: *** [/Users/admin/Downloads/tvheadend/build.darwin/src/webui/webui.o] Error 1
Can you please help?
Thank you!
History
Updated by Miro K. about 10 years ago
I guess you have to replace the line 1227:
sprintf(range_buf, "bytes %"PRId64"-%"PRId64"/%"PRId64"",
with this:
sprintf(range_buf, "bytes %jd-%jd/%jd",
Seems Mavaricks has now bigger 'intmax_t' than 'long long'
Updated by Thomas M about 10 years ago
This helps with the first error, but the second still persists. As I am not a C programmer, I have no idea how to solve that. Sry :-)
CC src/webui/webui.o src/webui/webui.c:1229:27: error: format specifies type 'intmax_t' (aka 'long') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat] file_start, file_end, st.st_size); ^~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf' __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) ^ 1 error generated. make: *** [/Users/admin/Downloads/tvheadend/build.darwin/src/webui/webui.o] Error 1
Updated by Jaroslav Kysela about 10 years ago
I tried to fix it in v3.9-1502-ge5137f8 , could you test ?
Updated by Thomas M about 10 years ago
The upper problem is now fixed, but a new issue is now in muxer.c:
CC src/muxer.o src/muxer.c:463:2: error: invalid preprocessing directive #elseif !ENABLE_ANDROID ^ src/muxer.c:464:5: error: implicit declaration of function 'posix_fadvise' is invalid in C99 [-Werror,-Wimplicit-function-declaration] posix_fadvise(fd, pos, size, POSIX_FADV_DONTNEED); ^ src/muxer.c:464:34: error: use of undeclared identifier 'POSIX_FADV_DONTNEED' posix_fadvise(fd, pos, size, POSIX_FADV_DONTNEED); ^ 3 errors generated. make: *** [/Users/admin/Downloads/tvheadend/build.darwin/src/muxer.o] Error 1
Should I open a new issue?
Updated by Thomas M about 10 years ago
bash-3.2# uname -s
Darwin
Bit more info:
bash-3.2# uname -v
Darwin Kernel Version 13.3.0: Tue Jun 3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64
Updated by Jaroslav Kysela about 10 years ago
There is something wrong in the platform detection, the whole code in muxer is:
#if defined(PLATFORM_DARWIN)
fcntl(fd, F_NOCACHE, 1);
#elseif !ENABLE_ANDROID
posix_fadvise(fd, pos, size, POSIX_FADV_DONTNEED);
#endif
So there's a special code for Darwin. Could you check, if you have in the build directory file build.h with '#define PLATFORM_DARWIN 1' ?
Updated by Thomas M about 10 years ago
Yes her it is:
mediacenter:build.darwin admin$ grep "define PLATFORM_DARWIN" build.h
#define PLATFORM_DARWIN 1
Updated by Thomas M about 10 years ago
Can confirm that it's fixed now :-) I was able to compile the src. Still have some troubles, but this is another story ;-)
Thank you very much!