[GHC] #14784: RTS header files can't be used with a C++ compiler

#14784: RTS header files can't be used with a C++ compiler -------------------------------------+------------------------------------- Reporter: niteria | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Runtime | Version: System | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- If you compile `m1.cpp`: {{{ #include "Rts.h" int main(int argc, char** argv) { } }}} with: {{{ g++ -g m1.cpp -std=c++11 -I includes/ -c }}} you get: {{{ In file included from includes/Rts.h:29:0, from m1.cpp:1: includes/Stg.h:29:3: error: #error __STDC_VERSION__ does not advertise C99 or later # error __STDC_VERSION__ does not advertise C99 or later ^ }}} It's not advertised anywhere that it should work, but it used to work. https://phabricator.haskell.org/D2045 is what introduced this check. Judging by https://stackoverflow.com/questions/48045243/ghc-gcc-compiler- issue-stdc-version-w-c99-from-stg-h-fails-for-every-packa, it affects GHC 8.2 and later. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14784 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14784: RTS header files can't be used with a C++ compiler -------------------------------------+------------------------------------- Reporter: niteria | Owner: hvr Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Runtime System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * owner: (none) => hvr * priority: normal => highest * milestone: => 8.4.1 Comment: This is a regression and will break some existing uses of the RTS, so we should get it fixed before the release. Assigning to @hvr as the author of Phab:D2045 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14784#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14784: RTS header files can't be used with a C++ compiler -------------------------------------+------------------------------------- Reporter: niteria | Owner: hvr Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Runtime System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by hvr): Ok, so, the check at that place is to fail early, in case C compiler is thrown at the RTS header files while *not* being in C99 mode (due to misconfiguration or whatever), rather than run into less obvious compile errors lateron. If we can establish the minimum version of ISO C++ which supports all C99 features we rely on, we can tweak the CPP check to something like e.g. {{{#!c #if !((__cplusplus >= 201103L) || (__STDC_VERSION__ >= 199901L)) # error __STDC_VERSION__ does not advertise C99 or later, nor C++11 or later #endif }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14784#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14784: RTS header files can't be used with a C++ compiler -------------------------------------+------------------------------------- Reporter: niteria | Owner: hvr Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Runtime System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by gilmi): Hello, any news on this bug? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14784#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14784: RTS header files can't be used with a C++ compiler -------------------------------------+------------------------------------- Reporter: niteria | Owner: hvr Type: bug | Status: new Priority: highest | Milestone: 8.6.2 Component: Runtime System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * milestone: 8.4.1 => 8.6.2 Comment: I'd forgotten about this, we should get it fixed. It will certainly block us when we import GHC 8.4.x at work. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14784#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14784: RTS header files can't be used with a C++ compiler -------------------------------------+------------------------------------- Reporter: niteria | Owner: hvr Type: bug | Status: new Priority: highest | Milestone: 8.6.3 Component: Runtime System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.6.2 => 8.6.3 Comment: Unless we plan on fixing this in the next 48 hours I'm not sure this will make it into 8.6.2. That being said, I agree that we should fix this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14784#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14784: RTS header files can't be used with a C++ compiler -------------------------------------+------------------------------------- Reporter: niteria | Owner: hvr Type: bug | Status: patch Priority: highest | Milestone: 8.6.3 Component: Runtime System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5244 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D5244 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14784#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14784: RTS header files can't be used with a C++ compiler
-------------------------------------+-------------------------------------
Reporter: niteria | Owner: hvr
Type: bug | Status: patch
Priority: highest | Milestone: 8.6.3
Component: Runtime System | Version:
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5244
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14784: RTS header files can't be used with a C++ compiler -------------------------------------+------------------------------------- Reporter: niteria | Owner: hvr Type: bug | Status: closed Priority: highest | Milestone: 8.8.1 Component: Runtime System | Version: Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5244 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: 8.6.3 => 8.8.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14784#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC