[commit: ghc] master: Fix GCC 7 warning in the RTS (bea18a0)

git at git.haskell.org git at git.haskell.org
Mon Jun 19 12:16:19 UTC 2017


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

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

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

commit bea18a0e9ea5ff2063ca4900acad9995f40276eb
Author: Sylvain Henry <hsyl20 at gmail.com>
Date:   Sun Jun 18 16:50:09 2017 -0400

    Fix GCC 7 warning in the RTS
    
    Test Plan: validate
    
    Reviewers: austin, bgamari, erikd, simonmar
    
    Reviewed By: bgamari, simonmar
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3648


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

bea18a0e9ea5ff2063ca4900acad9995f40276eb
 rts/RtsFlags.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index b51d644..73635cf 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -1559,6 +1559,10 @@ openStatsFile (char *filename,           // filename, or NULL
         if (*filename != '\0') {  /* stats file specified */
             f = fopen(filename,"w");
         } else {
+            if (filename_fmt == NULL) {
+                errorBelch("Invalid stats filename format (NULL)\n");
+                return -1;
+            }
             /* default <program>.<ext> */
             char stats_filename[STATS_FILENAME_MAXLEN];
             sprintf(stats_filename, filename_fmt, prog_name);



More information about the ghc-commits mailing list