[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 2 commits: osReserveHeapMemory: handle signed rlim_t

Marge Bot gitlab at gitlab.haskell.org
Tue Apr 23 07:07:16 UTC 2019



 Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
89d8fe96 by Fraser Tweedale at 2019-04-23T07:07:12Z
osReserveHeapMemory: handle signed rlim_t

rlim_t is a signed type on FreeBSD, and the build fails with a
sign-compare error.  Add explicit (unsigned) cast to handle this
case.

- - - - -
03db9638 by Alexandre Baldé at 2019-04-23T07:07:14Z
Fix error message for './configure' regarding '--with-ghc' [skip ci]

- - - - -


2 changed files:

- configure.ac
- rts/posix/OSMem.c


Changes:

=====================================
configure.ac
=====================================
@@ -168,7 +168,7 @@ then
      $WithGhc is a development snapshot of GHC, version $GhcVersion.
      Bootstrapping using this version of GHC is not supported, and may not
      work.  Use --enable-bootstrap-with-devel-snapshot to try it anyway,
-     or --with-ghc to specify a different GHC to use.])
+     or 'GHC=' to specify a different GHC to use.])
     fi
 fi
 


=====================================
rts/posix/OSMem.c
=====================================
@@ -546,10 +546,12 @@ void *osReserveHeapMemory(void *startAddressPtr, W_ *len)
 
 #if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_SYS_TIME_H)
     struct rlimit limit;
+    /* rlim_t is signed on some platforms, including FreeBSD;
+     * explicitly cast to avoid sign compare error */
     if (!getrlimit(RLIMIT_AS, &limit)
         && limit.rlim_cur > 0
-        && *len > limit.rlim_cur) {
-        *len = limit.rlim_cur;
+        && *len > (unsigned) limit.rlim_cur) {
+        *len = (unsigned) limit.rlim_cur;
     }
 #endif
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/151a15749bd27d48d44dfd7e1fc874088931e9b3...03db9638ae206442568d68e598d41cce6cc5591f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/151a15749bd27d48d44dfd7e1fc874088931e9b3...03db9638ae206442568d68e598d41cce6cc5591f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190423/5969b55f/attachment-0001.html>


More information about the ghc-commits mailing list