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/LinkerInternals.h | |
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/LinkerInternals.h')
-rw-r--r-- | rts/LinkerInternals.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h index 16fbab2b29..a04db77b92 100644 --- a/rts/LinkerInternals.h +++ b/rts/LinkerInternals.h @@ -91,7 +91,8 @@ typedef struct ForeignExportStablePtr_ { struct ForeignExportStablePtr_ *next; } ForeignExportStablePtr; -#if powerpc_HOST_ARCH || x86_64_HOST_ARCH || arm_HOST_ARCH +#if defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) \ + || defined(arm_HOST_ARCH) /* ios currently uses adjacent got tables, and no symbol extras */ #if !defined(ios_HOST_OS) #define NEED_SYMBOL_EXTRAS 1 @@ -102,17 +103,17 @@ typedef struct ForeignExportStablePtr_ { * address relocations on the PowerPC, x86_64 and ARM. */ typedef struct { -#ifdef powerpc_HOST_ARCH +#if defined(powerpc_HOST_ARCH) struct { short lis_r12, hi_addr; short ori_r12_r12, lo_addr; long mtctr_r12; long bctr; } jumpIsland; -#elif x86_64_HOST_ARCH +#elif defined(x86_64_HOST_ARCH) uint64_t addr; uint8_t jumpIsland[6]; -#elif arm_HOST_ARCH +#elif defined(arm_HOST_ARCH) uint8_t jumpIsland[16]; #endif } SymbolExtra; @@ -283,7 +284,7 @@ ObjectCode* mkOc( pathchar *path, char *image, int imageSize, int misalignment ); -#if defined (mingw32_HOST_OS) +#if defined(mingw32_HOST_OS) /* We use myindex to calculate array addresses, rather than simply doing the normal subscript thing. That's because some of the above structs have sizes which are not |