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/RtsUtils.c | |
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/RtsUtils.c')
-rw-r--r-- | rts/RtsUtils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c index 85f951addd..996d28ac4c 100644 --- a/rts/RtsUtils.c +++ b/rts/RtsUtils.c @@ -22,7 +22,7 @@ /* HACK: On Mac OS X 10.4 (at least), time.h doesn't declare ctime_r with * _POSIX_C_SOURCE. If this is the case, we declare it ourselves. */ -#if HAVE_CTIME_R && !HAVE_DECL_CTIME_R +#if defined(HAVE_CTIME_R) && !HAVE_DECL_CTIME_R extern char *ctime_r(const time_t *, char *); #endif @@ -164,7 +164,7 @@ time_str(void) if (now == 0) { time(&now); -#if HAVE_CTIME_R +#if defined(HAVE_CTIME_R) ctime_r(&now, nowstr); #else strcpy(nowstr, ctime(&now)); |