[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 03:37:04 UTC 2019



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


Commits:
41affe1e by Fraser Tweedale at 2019-04-23T03:36:59Z
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.

- - - - -
151a1574 by Alexandre Baldé at 2019-04-23T03:37:01Z
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/fe1a29185d2d0a16b4aae9c59dcb98ff8f551a25...151a15749bd27d48d44dfd7e1fc874088931e9b3

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/fe1a29185d2d0a16b4aae9c59dcb98ff8f551a25...151a15749bd27d48d44dfd7e1fc874088931e9b3
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/20190422/cbc179e6/attachment-0001.html>


More information about the ghc-commits mailing list