Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning: treating <U+2227> as identifier character #646

Closed
philderbeast opened this issue Oct 17, 2018 · 7 comments · Fixed by #2561
Closed

warning: treating <U+2227> as identifier character #646

philderbeast opened this issue Oct 17, 2018 · 7 comments · Fixed by #2561

Comments

@philderbeast
Copy link

Is this warning harmless?

dhall-haskell> stack repl

Warning: There were multiple candidates for the Cabal entry " Dhall.Main
         * /.../dhall-haskell/Dhall/Main.hs
         picking: /.../dhall-haskell/src/Dhall/Main.hs

Warning: There were multiple candidates for the Cabal entry " Dhall.Main
         * /.../dhall-haskell/Dhall/Main.hs
         picking: /.../dhall-haskell/src/Dhall/Main.hs

Warning: There were multiple candidates for the Cabal entry " Dhall.Main
         * /.../dhall-haskell/Dhall/Main.hs
         picking: /.../dhall-haskell/src/Dhall/Main.hs
Configuring GHCi with the following packages: dhall
Using main module: 1. Package `dhall' component exe:dhall
with main-is file: /.../dhall-haskell/dhall/Main.hs
GHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /Users/pdejoux/.ghci

/.../dhall-haskell/src/Dhall/Core.hs:435:58: error:
     warning: treating Unicode character <U+2227> as identifier character
rather than as '^' symbol [-Wunicode-homoglyph]
        -- | > Combine x y                              ~  x ∧ y
                                                             ^
    |
435 |     -- | > Combine x y                              ~  x ∧ y
    |
@philderbeast philderbeast changed the title warning: treating Unicode character <U+2227> as identifier character warning: treating <U+2227> as identifier character Oct 17, 2018
@Gabriella439
Copy link
Collaborator

I assume it should be harmless since that is pointing to a character in a Haddock comment. I'm actually a bit surprised that you got that warning at all since (A) Dhall's CI enforces that Dhall builds against GHC 8.4.3 without any warnings and (B) it seems like a bug if the interpreter is treating a comment character as an identifier

@philderbeast
Copy link
Author

I logged a ticket about this with ghc.

@Gabriella439
Copy link
Collaborator

Thanks for doing that! 🙂

@mattpolzin
Copy link

Not sure whether to resurrect this ticket, but since it is clearly an extension of the same conversation, I tried to build via Nix and saw the same warnings (albeit in different files) as errors.

For example:

src/Dhall/Tutorial.hs:889:31: error:
     error: treating Unicode character <U+2227> as identifier character rather than as '^' symbol [-Werror,-Wunicode-homoglyph]
    |
889 | -- The @(/\\)@ operator (or @(∧)@ U+2227) also lets you combine records, but
    |                               ^
-- The @(/\\)@ operator (or @(∧)@ U+2227) also lets you combine records, but

Wondering if this is a misconfiguration of the Nix tooling (i.e. should not have -Wunicode-homoglyph applied). The only thing in the Nix files I saw quickly was where failOnAllWarnings was being applied, but that might not even be related to this because that should add -Wall not -Wunicode-homoglyph.

@mattpolzin
Copy link

Well, I looked at the ticket referenced above now. Should have done that first; turns out this warning is actually part of the C preprocessor and further it seems specific to clang and maybe even certain clang versions. That means, sadly, I was unable to build dhall-haskell (due to being on MacOS) using any of the 3 build methods (cabal, stack, or nix). Cabal failed to resolve non-conflicting dependencies, Stack failed to build certain dependencies with linker errors, and Nix failed because of a warning from the clang C preprocessor. :(

@Gabriella439
Copy link
Collaborator

I'm more than happy to accept a PR to remove the offending character. It's just that I can't reproduce the problem locally so I don't have an easy way to verify that any change of mine would fix it.

I'm also using clang (specifically, the one provided by a Nix shell), so I think it's definitely something that affects a specific version of clang:

$ "$CC" --version
clang version 11.1.0
Target: aarch64-apple-darwin
Thread model: posix
InstalledDir: /nix/store/3zy8k5xl5s9cmcghgd90c05dga0j5h6a-clang-11.1.0/bin

@Gabriella439
Copy link
Collaborator

Reopening because I have a reproduction and I think I know how to fix this

@Gabriella439 Gabriella439 reopened this Dec 28, 2023
Gabriella439 added a commit that referenced this issue Dec 28, 2023
Fixes #646

This fixes a build failure that tends to happen when building Dhall
using Nix on macOS.  The failure is related to the
`-Wunicode-homoglyph` `cpp` warning, which this change disables.
Gabriella439 added a commit that referenced this issue Dec 28, 2023
Fixes #646

This fixes a build failure that tends to happen when building Dhall
using Nix on macOS.  The failure is related to the
`-Wunicode-homoglyph` `cpp` warning, which this change disables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants