[Haskell-cafe] Error trying to build haskell-dbus on FreeBSD

Viktor Dukhovni ietf-dane at dukhovni.org
Sat Feb 1 09:01:26 UTC 2020


On Sat, Feb 01, 2020 at 12:26:32PM +0400, Gleb Popov wrote:

> Yep, the problem is with Clang's preprocessor. Running it manually results
> in a bunch of
> 
>     warning: missing terminating ' character [-Winvalid-pp-token]
> 
> messages.

I don't think it is just clang, the macros are not not valid
C-preprocessor input.

    $ for cpp in gcc{7,8,8} clang{37,39,60,70}; do
        printf "--- CPP: %s\n" "$cpp"
        printf "#define foo a' = b\nfoo\n" |
            $cpp -Werror -E - 2>&1
        printf "EXIT: $?\n"
      done | egrep -v '^# [0-9]|^$'
    --- CPP: gcc7
    <stdin>:1:14: error: missing terminating ' character [-Werror]
    a' = b
    cc1: all warnings being treated as errors
    EXIT: 1
    --- CPP: gcc8
    <stdin>:1:14: error: missing terminating ' character [-Werror]
    a' = b
    cc1: all warnings being treated as errors
    EXIT: 1
    --- CPP: gcc8
    <stdin>:1:14: error: missing terminating ' character [-Werror]
    a' = b
    cc1: all warnings being treated as errors
    EXIT: 1
    --- CPP: clang37
    <stdin>:1:14: error: missing terminating ' character
    [-Werror,-Winvalid-pp-token]
    #define foo a' = b
                 ^
    a' = b
    1 error generated.
    EXIT: 1
    --- CPP: clang39
    <stdin>:1:14: error: missing terminating ' character
    [-Werror,-Winvalid-pp-token]
    #define foo a' = b
                 ^
    a' = b
    1 error generated.
    EXIT: 1
    --- CPP: clang60
    <stdin>:1:14: error: missing terminating ' character
    [-Werror,-Winvalid-pp-token]
    #define foo a' = b
                 ^
    a' = b
    1 error generated.
    EXIT: 1
    --- CPP: clang70
    <stdin>:1:14: error: missing terminating ' character
    [-Werror,-Winvalid-pp-token]
    #define foo a' = b
                 ^
    a' = b
    1 error generated.
    EXIT: 1

> This is the case for IsValue instance, which contain typeOf' method.
> 
> Not sure if this should be reported to the package developer, GHC devs or
> Clang devs.

The package developer.  Neither GHC nor Clang are at-fault for invalid
CPP macro syntax.

-- 
    Viktor.


More information about the Haskell-Cafe mailing list