[GHC] #14946: GHC Calls CPP for HS with -undef

GHC ghc-devs at haskell.org
Tue Mar 20 12:03:00 UTC 2018


#14946: GHC Calls CPP for HS with -undef
-------------------------------------+-------------------------------------
        Reporter:  Phyx-             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by Phyx-:

Old description:

> GHC Is calling the C preprocessor[1] when processing HS files with
> `-undef` which unsets and compiler pre-defines.
>
> Essentially it means you cannot use any normal compiler defines to check
> for platform or intrinsics support.
>
> Is this really the intended behavior?
>
> [1]
> https://github.com/ghc/ghc/blob/60aa53d97da1bbfbb88e9f2791c3f686ba34e764/aclocal.m4#L2241

New description:

 GHC Is calling the C preprocessor[1] when processing HS files with
 `-undef` which unsets the C compiler pre-defines.

 Essentially it means you cannot use any normal compiler defines to check
 for platform or intrinsics support.

 Is this really the intended behavior?

 I get the fact that we're processing a Haskell source file, but why
 restrict the pre-processor to only GHC defines. You lose information like
 if unaligned accesses are supported or not etc.

 [1]
 https://github.com/ghc/ghc/blob/60aa53d97da1bbfbb88e9f2791c3f686ba34e764/aclocal.m4#L2241

--

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14946#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list