Commit d27c6262 authored by ghpzin's avatar ghpzin Committed by Matthieu Coudron
Browse files

rs: fix build with gcc14

- add `-DNEED_STRTONUM` flag to include declaration of `strtonum`
from `rs.h`:
```
#ifdef NEED_STRTONUM
/* .linked/strtonum.c */
extern long long strtonum(const char *, long long, long long, const char **);
#endif
```
Fixes `implicit-function-declaration` error with gcc 14:
```
rs.c: In function 'getargs':
rs.c:410:34: error: implicit declaration of function 'strtonum';
did you mean 'strtouq'? []
  410 |                         owidth = strtonum(optarg, 1, INT_MAX, &errstr);
      |                                  ^~~~~~~~
      |                                  strtouq
```
parent 21ec8478
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
  buildPhase = ''
    runHook preBuild

    ${stdenv.cc}/bin/cc utf8.c rs.c -o rs -lbsd
    ${stdenv.cc}/bin/cc -DNEED_STRTONUM utf8.c rs.c -o rs -lbsd

    runHook postBuild
  '';