diff options
author | Erik de Castro Lopo <erik.decastrolopo@ambiata.com> | 2017-04-05 05:53:46 +1000 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-04-28 22:35:04 -0400 |
commit | e5b3492f23c2296d0d8221e1787ee585331f726e (patch) | |
tree | e1d6797dadc265db7f97615ff71c65c3d83db9c0 /rts/Schedule.c | |
parent | 6d14c1485cb570cbd183bcdc0f858d9a6dc1eb31 (diff) | |
download | haskell-e5b3492f23c2296d0d8221e1787ee585331f726e.tar.gz |
Enable new warning for fragile/incorrect CPP #if usage
The C code in the RTS now gets built with `-Wundef` and the Haskell code
(stages 1 and 2 only) with `-Wcpp-undef`. We now get warnings whereever
`#if` is used on undefined identifiers.
Test Plan: Validate on Linux and Windows
Reviewers: austin, angerman, simonmar, bgamari, Phyx
Reviewed By: bgamari
Subscribers: thomie, snowleopard
Differential Revision: https://phabricator.haskell.org/D3278
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r-- | rts/Schedule.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c index b77e7a21ef..296461b38d 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -411,7 +411,7 @@ run_thread: prev_what_next = t->what_next; errno = t->saved_errno; -#if mingw32_HOST_OS +#ifdef mingw32_HOST_OS SetLastError(t->saved_winerror); #endif @@ -490,7 +490,7 @@ run_thread: // XXX: possibly bogus for SMP because this thread might already // be running again, see code below. t->saved_errno = errno; -#if mingw32_HOST_OS +#ifdef mingw32_HOST_OS // Similarly for Windows error code t->saved_winerror = GetLastError(); #endif @@ -2374,12 +2374,12 @@ suspendThread (StgRegTable *reg, bool interruptible) int saved_errno; StgTSO *tso; Task *task; -#if mingw32_HOST_OS +#ifdef mingw32_HOST_OS StgWord32 saved_winerror; #endif saved_errno = errno; -#if mingw32_HOST_OS +#ifdef mingw32_HOST_OS saved_winerror = GetLastError(); #endif @@ -2419,7 +2419,7 @@ suspendThread (StgRegTable *reg, bool interruptible) RELEASE_LOCK(&cap->lock); errno = saved_errno; -#if mingw32_HOST_OS +#ifdef mingw32_HOST_OS SetLastError(saved_winerror); #endif return task; @@ -2433,12 +2433,12 @@ resumeThread (void *task_) Capability *cap; Task *task = task_; int saved_errno; -#if mingw32_HOST_OS +#ifdef mingw32_HOST_OS StgWord32 saved_winerror; #endif saved_errno = errno; -#if mingw32_HOST_OS +#ifdef mingw32_HOST_OS saved_winerror = GetLastError(); #endif @@ -2475,7 +2475,7 @@ resumeThread (void *task_) cap->r.rCurrentTSO = tso; cap->in_haskell = true; errno = saved_errno; -#if mingw32_HOST_OS +#ifdef mingw32_HOST_OS SetLastError(saved_winerror); #endif |