[commit: ghc] master: RtsFlags: Un-constify temporary buffer (378091c)

git at git.haskell.org git at git.haskell.org
Sun Apr 10 21:40:03 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/378091c9ef6d25a076125f0b82dce1a155c0e8f0/ghc

>---------------------------------------------------------------

commit 378091c9ef6d25a076125f0b82dce1a155c0e8f0
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sun Apr 10 23:28:46 2016 +0200

    RtsFlags: Un-constify temporary buffer
    
    Otherwise we get a const-ness mismatch when we free the buffer, which
    for some reason gcc 5.3 didn't notice.


>---------------------------------------------------------------

378091c9ef6d25a076125f0b82dce1a155c0e8f0
 rts/RtsFlags.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 7f0821a..9db3cd4 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -1566,7 +1566,7 @@ static rtsBool read_heap_profiling_flag(const char *arg_in)
     // However, for sanity we want to guarantee const-correctness and parsing
     // really ought to be an immutable operation. To avoid rewriting the parser
     // we just operate on a temporary copy of the argument.
-    const char *arg = strdup(arg_in);
+    char *arg = strdup(arg_in);
     rtsBool error = rtsFalse;
     switch (arg[2]) {
     case '\0':



More information about the ghc-commits mailing list