[GHC] #9213: CPP warnings on ghcautoconf.h

#9213: CPP warnings on ghcautoconf.h ------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- The cpphs program yields the following warning: {{{ Warning: trailing characters after #if directive in file ... /ghcautoconf.h at line 383 col 1: AC_APPLE_UNIVERSAL_BUILD }}} I guess it is necessary to replace `#if defined` by `#ifdef` in the line {{{ #if defined AC_APPLE_UNIVERSAL_BUILD }}} from the mk/config.h.in file. Note the next line `# if defined __BIG_ENDIAN__` has the same issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h from cpphs -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Differential Revisions: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: Difficulty: Unknown | Blocking: Blocked By: | Related Tickets: | -------------------------------------+------------------------------------- Changes (by asr): * version: 7.8.2 => 7.8.3 Old description:
The cpphs program yields the following warning:
{{{ Warning: trailing characters after #if directive in file ... /ghcautoconf.h at line 383 col 1: AC_APPLE_UNIVERSAL_BUILD }}}
I guess it is necessary to replace `#if defined` by `#ifdef` in the line {{{ #if defined AC_APPLE_UNIVERSAL_BUILD }}} from the mk/config.h.in file.
Note the next line `# if defined __BIG_ENDIAN__` has the same issue.
New description: cpphs 1.18.5 yields the following warning: {{{ Warning: trailing characters after #if directive in file ... /ghcautoconf.h at line 383 col 1: AC_APPLE_UNIVERSAL_BUILD }}} I guess it is necessary to replace `#if defined` by `#ifdef` in the line {{{ #if defined AC_APPLE_UNIVERSAL_BUILD }}} from the mk/config.h.in file. Note the next line {{{ # if defined __BIG_ENDIAN__ }}} has the same issue. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h from cpphs -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => infoneeded Comment: Thank you for the report. You mention: "cpphs 1.18.5 yields the following warning". Can you supply the steps needed to reproduce this. Do you mean during the building/installation of cpphs, or when you run it some on some inputfile? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h from cpphs -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by asr): You can reproduce the issue by installing Agda (sorry I know this is not a simple package). Note that Agda uses cpphs as the default C preprocessor. {{{cabal install Agda-2.4.2.1}}} {{{...}}} {{{Preprocessing library Agda-2.4.2.1...}}} {{{Warning: trailing characters after #if directive in file /usr/local/stow/ghc-7.8.3-bin/lib/ghc-7.8.3/include/ghcautoconf.h at line 383 col 1: AC_APPLE_UNIVERSAL_BUILD}}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h from cpphs -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4-rc1 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by asr): * version: 7.8.3 => 7.8.4-rc1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h from cpphs -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4-rc1 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Description changed by asr: Old description:
cpphs 1.18.5 yields the following warning:
{{{ Warning: trailing characters after #if directive in file ... /ghcautoconf.h at line 383 col 1: AC_APPLE_UNIVERSAL_BUILD }}}
I guess it is necessary to replace `#if defined` by `#ifdef` in the line {{{ #if defined AC_APPLE_UNIVERSAL_BUILD }}} from the mk/config.h.in file.
Note the next line {{{ # if defined __BIG_ENDIAN__ }}} has the same issue.
New description: cpphs 1.18.6 yields the following warning: {{{ Warning: trailing characters after #if directive in file ... /ghcautoconf.h at line 383 col 1: AC_APPLE_UNIVERSAL_BUILD }}} I guess it is necessary to replace `#if defined` by `#ifdef` in the line {{{ #if defined AC_APPLE_UNIVERSAL_BUILD }}} from the mk/config.h.in file. Note the next line {{{ # if defined __BIG_ENDIAN__ }}} has the same issue. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h from cpphs -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by asr): * version: 7.8.4-rc1 => 7.8.4 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h from cpphs -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by asr): I realised Alex is including the file {{{ghcconfig.h}}} which generates the warning when using cpphs. An example using the file https://github.com/simonmar/alex/blob/master/examples/Tokens.x: {{{ $ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.8.4 $ alex --version Alex version 3.1.4, (c) 2003 Chris Dornan and Simon Marlow $ cpphs --version cpphs 1.18.6 $ alex Tokens.x $ ghc -pgmPcpphs -optP--cpp Tokens.hs Warning: trailing characters after #if directive in file /usr/local/stow/ghc-7.8.4-bin/lib/ghc-7.8.4/include/ghcautoconf.h at line 383 col 1: AC_APPLE_UNIVERSAL_BUILD [1 of 1] Compiling Main ( Tokens.hs, Tokens.o ) Linking Tokens ... }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h from cpphs -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by asr): * version: 7.8.4 => 7.10.1-rc1 Comment: And using GHC 7.10.1 RC1, I got an additional warning: {{{ $ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.10.0.20141222 $ ghc -pgmPcpphs -optP--cpp Tokens.hs Warning: Can't find file "/usr/local/stow/ghc-7.10.0.20141222-bin/lib/ghc-7.10.0.20141222/include/ghcversion.h" in directories . /usr/local/stow/ghc-7.10.0.20141222-bin/lib/ghc-7.10.0.20141222/base_469rOtLAqwTGFEOGWxSUiQ/include /usr/local/stow/ghc-7.10.0.20141222-bin/lib/ghc-7.10.0.20141222/integ_21cuTlnn00eFNd4GMrxOMi/include /usr/local/stow/ghc-7.10.0.20141222-bin/lib/ghc-7.10.0.20141222/include Asked for by: Tokens.hs at line 1 col 1 Warning: trailing characters after #if directive in file /usr/local/stow/ghc-7.10.0.20141222-bin/lib/ghc-7.10.0.20141222/include/ghcautoconf.h at line 379 col 1: AC_APPLE_UNIVERSAL_BUILD }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h from cpphs -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by asr): * status: infoneeded => new -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h from cpphs -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by asr): * milestone: => 7.10.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h from cpphs -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by asr): A minimal example (using cpp 1.18.6 and GHC 7.10.1 RC1): {{{ $ cat Main.hs {-# LANGUAGE CPP #-} module Main where -- Used for example by Alex 3.1.4 and GHC source code. #include "ghcconfig.h" main :: IO () main = putStrLn "Hello, World!" }}} {{{ $ ghc -pgmP cpphs -optP --cpp Main.hs ... Warning: trailing characters after #if directive in file /usr/local/stow/ghc-7.10.0.20141222-bin/lib/ghc-7.10.0.20141222/include/ghcautoconf.h at line 379 col 1: AC_APPLE_UNIVERSAL_BUILD }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.10.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by asr): * version: 7.10.1-rc1 => 7.10.1-rc2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thoughtpolice): * milestone: 7.10.1 => 7.12.1 Comment: Moving to 7.12 for now. FWIW, I can't quite tell if `cpphs` correctly handles this `#if define` syntax (which I assume traditional CPP does), meaning maybe upstream should fix it, but I don't think at the moment it's going to break anything severe based on this example. OTOH, this can probably be mitigated by modifying the rules to generate `ghcautoconf.mk`, which is actually a copy of some autoconf output created during the build; a `sed` invocation could probably do it - the rule to generate ghcautoconf is in `includes/ghc.mk` (search for `__GHCAUTOCONF_H__`). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9213: Maybe important CPP warnings on ghcautoconf.h -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.1-rc2 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by asr): * status: new => closed * resolution: => invalid Comment: cpphs 1.18.8 doesn't handle the `#if defined` syntax, so it isn't a GHC bug. I'll report the issue to cpphs' author. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9213#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC