
I think gcc has some internal magic with its cpp (and same for clang). If you compile using `gcc -E wat.c | gcc -x c -` you will run into exactly
#14113: Error message carets point at the wrong places in the presence of CPP macros -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Replying to [comment:3 Rufflewind]: the same bug here.
{{{ wat.c: In function ‘main’: wat.c:4:12: warning: return makes integer from pointer without a cast
[-Wint-conversion]
FOO ^ }}}
cpp simply does not provide ghc with adequate line information to
determine the correct column. Urk, I was afraid of that. Well, if there isn't a reliable way to obtain this information, I suppose there isn't much we can do here. You mentioned that we could suppress the caret if CPP is involved, although I don't know if it's possible to reliably detect that. Alternatively, we could not do anything and close this as wontfix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14113#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler