diff options
author | Erik de Castro Lopo <erik.decastrolopo@ambiata.com> | 2017-04-05 05:53:46 +1000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2017-04-05 05:53:47 +1000 |
commit | 7e340c2bbf4a56959bd1e95cdd1cfdb2b7e537c2 (patch) | |
tree | 0f330ad348b5100f1a21312e7c91e43966789ec8 /rts/posix/itimer | |
parent | 5e968f9261b798222a845ef38a54621b45013678 (diff) | |
download | haskell-7e340c2bbf4a56959bd1e95cdd1cfdb2b7e537c2.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/posix/itimer')
-rw-r--r-- | rts/posix/itimer/Pthread.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rts/posix/itimer/Pthread.c b/rts/posix/itimer/Pthread.c index 3b31fe4103..5c708ecf4d 100644 --- a/rts/posix/itimer/Pthread.c +++ b/rts/posix/itimer/Pthread.c @@ -65,7 +65,7 @@ #include <unistd.h> #include <fcntl.h> -#if HAVE_SYS_TIMERFD_H +#ifdef HAVE_SYS_TIMERFD_H #include <sys/timerfd.h> #define USE_TIMERFD_FOR_ITIMER 1 #else @@ -101,7 +101,7 @@ static void *itimer_thread_func(void *_handle_tick) uint64_t nticks; int timerfd = -1; -#if USE_TIMERFD_FOR_ITIMER +#if defined(USE_TIMERFD_FOR_ITIMER) && USE_TIMERFD_FOR_ITIMER struct itimerspec it; it.it_value.tv_sec = TimeToSeconds(itimer_interval); it.it_value.tv_nsec = TimeToNS(itimer_interval) % 1000000000; @@ -169,7 +169,7 @@ initTicker (Time interval, TickProc handle_tick) * to the thread we create so we can later join to it if requested */ if (! pthread_create(&thread, NULL, itimer_thread_func, (void*)handle_tick)) { -#if HAVE_PTHREAD_SETNAME_NP +#ifdef HAVE_PTHREAD_SETNAME_NP pthread_setname_np(thread, "ghc_ticker"); #endif } else { |