Unverified Commit c7e5e5a0 authored by Michael Daniels's avatar Michael Daniels Committed by GitHub
Browse files

fastcap: fix build with gcc15 (#506129)

parents eb0a7794 6b4db724
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
Fix implicit int truncating points in 64 bit systems.
--- a/src/mulGlobal.h
+++ b/src/mulGlobal.h
@@ -77,6 +77,8 @@
 /* #define MALCORE malloc */
 #define MALCORE ualloc
 
+extern char *ualloc(unsigned int);
+
 /* counts of memory usage by multipole matrix type */
 extern long memcount;
 extern long memQ2M;
+10 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ stdenv.mkDerivation (finalAttrs: {
  patches = [
    ./fastcap-mulglobal-drop-conflicting-lib.patch
    ./fastcap-mulsetup-add-forward-declarations.patch
    ./fastcap-mulglobal-add-ualloc-declaration.patch
  ];

  nativeBuildInputs = [
@@ -28,7 +29,7 @@ stdenv.mkDerivation (finalAttrs: {

  postPatch = ''
    substituteInPlace ./doc/Makefile \
      --replace '/bin/rm' 'rm'
      --replace-fail '/bin/rm' 'rm'

    for f in "doc/*.tex" ; do
      sed -i -E $f \
@@ -54,8 +55,14 @@ stdenv.mkDerivation (finalAttrs: {
    "all"
  ];

  # GCC 14 makes these errors by default
  env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=return-mismatch -Wno-error=implicit-int";
  env.NIX_CFLAGS_COMPILE = toString [
    # gcc14
    "-Wno-error=implicit-function-declaration"
    "-Wno-error=return-mismatch"
    "-Wno-error=implicit-int"
    # gcc15
    "-std=gnu17"
  ];

  outputs = [
    "out"