diff options
Diffstat (limited to 'rts/hooks/StackOverflow.c')
-rw-r--r-- | rts/hooks/StackOverflow.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/rts/hooks/StackOverflow.c b/rts/hooks/StackOverflow.c index 1ae8603eec..602700ad77 100644 --- a/rts/hooks/StackOverflow.c +++ b/rts/hooks/StackOverflow.c @@ -14,12 +14,15 @@ void StackOverflowHook (W_ stack_size) /* in bytes */ { - fprintf(stderr, - "Stack space overflow: current size %" FMT_Word " bytes.\n" - "%s `+RTS -Ksize -RTS' to increase it.\n", - stack_size, - ((rtsConfig.rts_opts_enabled == RtsOptsAll) - ? "Use" - : "Relink with -rtsopts and use") - ); + errorBelch("Stack space overflow: current size %" FMT_Word " bytes.", + stack_size); + + if (rtsConfig.rts_opts_suggestions == rtsTrue) { + if (rtsConfig.rts_opts_enabled == RtsOptsAll) { + errorBelch("Use `+RTS -Ksize -RTS' to increase it."); + } else { + errorBelch("Relink with -rtsopts and " + "use `+RTS -Ksize -RTS' to increase it."); + } + } } |