Project

General

Profile

Error building 4.3: strncpy call in wrappers (problem building with gcc 8.1.0?)

Added by Robert Cameron over 6 years ago

So, on one my development machines I just updated the system, and now I can't seem to get master to build. It was building fine earlier, I updated the system, and now it won't build. The only relevant packages that updated were the big ones: glibc (2.26->2.27), binutils (2.29.1->2.30), and gcc (7.3.1->8.1.0)—basically the entire toolchain.

The error I'm receiving is:

src/wrappers.c: In function ‘tvhthread_create’:
src/wrappers.c:200:3: error: ‘strncpy’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation]
   strncpy(ts->name, "tvh:", 4);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Since it seems to be a problem with a function in glibc, that was my first thought. But other machines with the same version of glibc are building fine. So, my next thought was gcc. The machines on which master was building fine still had gcc 7.3.1. After I downgraded gcc back to 7.3.1, Tvheadend is back to building without problem.

Has anyone else had difficulty building master with gcc 8.1.0? And, has someone found a solution to building with gcc 8.1.0?


Replies (1)

RE: Error building 4.3: strncpy call in wrappers (problem building with gcc 8.1.0?) - Added by Robert Cameron over 6 years ago

I've temporarily gotten around this by passing CFLAGS_NO_WERROR=yes to make when building with gcc 8.1.0. I've also noticed a few commits on master with regards to the master branch, so maybe some of these will trickle down to 4.2 as well.

    (1-1/1)