Project

General

Profile

Bug #1983

compile error on x86_64 musl libc or similar

Added by Carlo Landmeter almost 11 years ago. Updated almost 11 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
General
Target version:
-
Start date:
2014-03-04
Due date:
% Done:

100%

Estimated time:
Found in version:
current master
Affected Versions:

Description

src/input/mpegts/tsfile/tsfile_input.c: In function 'tsfile_input_thread':
src/input/mpegts/tsfile/tsfile_input.c:87:3: error: format '%u' expects argument of type 'unsigned int', but argument 9 has type 'size_t' [-Werror=format=]
   tvhtrace("tsfile", "adapter %d file size %"PRIoff_t " rem %"PRIsize_t,
   ^
cc1: all warnings being treated as errors

cc1: all warnings being treated as errors
Makefile:302: recipe for target '/home/clandmeter/aports/testing/tvheadend-git/src/tvheadend-git-0_git20140301/build.linux/src/input/mpegts/tsfile/tsfile_input.o' failed
make: *** [/home/clandmeter/aports/testing/tvheadend-git/src/tvheadend-git-0_git20140301/build.linux/src/input/mpegts/tsfile/tsfile_input.o] Error 1
edge-musl-x86_64:~/aports/testing/tvheadend-git/src/tvheadend-git-0_git20140301$ vim +87 src/input/mpegts/tsfile/tsfile_input.c

edge-musl-x86_64:~/aports/testing/tvheadend-git/src/tvheadend-git-0_git20140301$ make
CC              src/input/mpegts/tsfile/tsfile_input.o
CC              src/input/mpegts/tsfile/tsfile_mux.o
CC              src/timeshift.o
CC              src/timeshift/timeshift_filemgr.o
CC              src/timeshift/timeshift_writer.o
CC              src/timeshift/timeshift_reader.o
src/timeshift/timeshift_reader.c: In function '_timeshift_read':
src/timeshift/timeshift_reader.c:339:5: error: format '%d' expects argument of type 'int', but argument 9 has type 'ssize_t' [-Werror=format=]
     tvhtrace("timeshift", "ts %d read msg %p (%"PRIssize_t")",
     ^
cc1: all warnings being treated as errors
Makefile:302: recipe for target '/home/clandmeter/aports/testing/tvheadend-git/src/tvheadend-git-0_git20140301/build.linux/src/timeshift/timeshift_reader.o' failed

edge-musl-x86_64:~/aports/testing/tvheadend-git/src/tvheadend-git-0_git20140301$ make
CC              src/timeshift/timeshift_reader.o
CC              src/dvr/dvr_inotify.o
CC              src/avahi.o
CC              src/descrambler/tvhcsa.o
CC              src/descrambler/cwc.o
src/descrambler/cwc.c: In function 'cwc_send_msg':
src/descrambler/cwc.c:490:3: error: format '%u' expects argument of type 'unsigned int', but argument 8 has type 'size_t' [-Werror=format=]
   tvhtrace("cwc", "sending message sid %d len %"PRIsize_t" enq %d", sid, len, enq);
   ^
cc1: all warnings being treated as errors

History

#1

Updated by Natanael Copa almost 11 years ago

Seems like problem comes from that __WORDSIZE is not defined on musl libc. (there are no standard that says that it should be defined or where).

It should be possible to use ULONG_MAX in limits.h to detect the wordsize.

Other option might be always use "%zu" for size_t printing, which is defined in C99.

#2

Updated by Adam Sutton almost 11 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset tvheadend|commit:51e68dc919ab57a745e1e2d1f3f41e2dcd0ace08.

Also available in: Atom PDF