diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2018-02-06 13:27:35 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-02-06 14:21:16 -0500 |
commit | 4d1c3b72ec27c8e51fb40809bba3ce35246a2966 (patch) | |
tree | 8a50e7647223fbdbd670e1e2bf97f84cc74ffd9f | |
parent | 1512b63347dff5aeae4a27d7421f7608cc43a196 (diff) | |
download | haskell-4d1c3b72ec27c8e51fb40809bba3ce35246a2966.tar.gz |
rts: Add format attribute to barf
Test Plan: Validate
Reviewers: erikd, simonmar
Reviewed By: simonmar
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4374
-rw-r--r-- | includes/rts/Messages.h | 3 | ||||
-rw-r--r-- | rts/Capability.c | 2 | ||||
-rw-r--r-- | rts/Schedule.c | 2 | ||||
-rw-r--r-- | rts/Threads.c | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/includes/rts/Messages.h b/includes/rts/Messages.h index 2a6a84b821..206d40fb8b 100644 --- a/includes/rts/Messages.h +++ b/includes/rts/Messages.h @@ -40,7 +40,8 @@ * expected to return. */ void barf(const char *s, ...) - GNUC3_ATTRIBUTE(__noreturn__); + GNUC3_ATTRIBUTE(__noreturn__) + GNUC3_ATTRIBUTE(format(printf, 1, 2)); void vbarf(const char *s, va_list ap) GNUC3_ATTRIBUTE(__noreturn__); diff --git a/rts/Capability.c b/rts/Capability.c index 0fcb0c99e1..03b2a86280 100644 --- a/rts/Capability.c +++ b/rts/Capability.c @@ -362,7 +362,7 @@ void initCapabilities (void) } n_numa_nodes = logical; if (logical == 0) { - barf("%s: available NUMA node set is empty"); + barf("available NUMA node set is empty"); } } diff --git a/rts/Schedule.c b/rts/Schedule.c index 8002ac37dc..349a77839a 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -271,7 +271,7 @@ schedule (Capability *initialCapability, Task *task) } break; default: - barf("sched_state: %d", sched_state); + barf("sched_state: %ld", sched_state); } scheduleFindWork(&cap); diff --git a/rts/Threads.c b/rts/Threads.c index b09dfa8ccc..b76917773a 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -876,7 +876,7 @@ printThreadBlockage(StgTSO *tso) debugBelch("is blocked on an STM operation"); break; default: - barf("printThreadBlockage: strange tso->why_blocked: %d for TSO %d (%d)", + barf("printThreadBlockage: strange tso->why_blocked: %d for TSO %d (%p)", tso->why_blocked, tso->id, tso); } } |