Commit 4d1c3b72 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

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
parent 1512b633
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
* expected to return. * expected to return.
*/ */
void barf(const char *s, ...) 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) void vbarf(const char *s, va_list ap)
GNUC3_ATTRIBUTE(__noreturn__); GNUC3_ATTRIBUTE(__noreturn__);
......
...@@ -362,7 +362,7 @@ void initCapabilities (void) ...@@ -362,7 +362,7 @@ void initCapabilities (void)
} }
n_numa_nodes = logical; n_numa_nodes = logical;
if (logical == 0) { if (logical == 0) {
barf("%s: available NUMA node set is empty"); barf("available NUMA node set is empty");
} }
} }
......
...@@ -271,7 +271,7 @@ schedule (Capability *initialCapability, Task *task) ...@@ -271,7 +271,7 @@ schedule (Capability *initialCapability, Task *task)
} }
break; break;
default: default:
barf("sched_state: %d", sched_state); barf("sched_state: %ld", sched_state);
} }
scheduleFindWork(&cap); scheduleFindWork(&cap);
......
...@@ -876,7 +876,7 @@ printThreadBlockage(StgTSO *tso) ...@@ -876,7 +876,7 @@ printThreadBlockage(StgTSO *tso)
debugBelch("is blocked on an STM operation"); debugBelch("is blocked on an STM operation");
break; break;
default: 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); tso->why_blocked, tso->id, tso);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment