libcli icon indicating copy to clipboard operation
libcli copied to clipboard

Build failure on darwin: `error: implicit declaration of function 'strchrnul' is invalid in C99`

Open trofi opened this issue 4 years ago • 0 comments

Noticed by @bobby285271 in https://github.com/NixOS/nixpkgs/pull/147749 when we attempted to update libcli in NixOS.

Build fails on Darwin libc as:

libcli.c:2521:41: error: implicit declaration of function 'strchrnul' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  if (help && !(c->help = strndup(help, strchrnul(help, '\v') - help))) {

Full build log: https://logs.nix.ci/?key=nixos/nixpkgs.147749&attempt_id=54ba70b3-6044-4233-ab14-a2ecea5c68e8

Looks like strchrnul() needs to be avoided on non-GNU systems.

trofi avatar Dec 17 '21 17:12 trofi