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

c2hs builds with -fno-warn-incomplete-patterns #179

Closed
kolmodin opened this issue Jan 21, 2017 · 8 comments
Closed

c2hs builds with -fno-warn-incomplete-patterns #179

kolmodin opened this issue Jan 21, 2017 · 8 comments

Comments

@kolmodin
Copy link
Member

kolmodin commented Jan 21, 2017

c2hs builds with

 ghc-options:    -Wall -fno-warn-incomplete-patterns -fwarn-tabs

and then fails at runtime;

c2hs: src/C2HS/Gen/Bind.hs:(1426,5)-(1444,66): Non-exhaustive patterns in function addDft
@kolmodin kolmodin changed the title c2hs builds with ghc-options: -Wall -fno-warn-incomplete-patterns -fwarn-tabs c2hs builds with -fno-warn-incomplete-patterns Jan 21, 2017
@kolmodin
Copy link
Member Author

Turning the incomplete patterns warnings back on;

src/C2HS/Gen/Bind.hs:1426:5: warning: [-Wincomplete-patterns]
    Pattern match(es) are non-exhaustive
    In an equation for ‘addDft’:
        Patterns not matched:
            (CHSPlusParm _:_) []
            (CHSParm _ _ True _ _ _ _:_) [_]

@kolmodin
Copy link
Member Author

I had written this c2hs code;

-- | Validate the key of a metadata pair.
{#fun pure grpc_header_key_is_legal as isKeyValid
  { 'useAsCStringLen'* `B.ByteString'&} -> `Bool' #}

But the C code had been updated from char*, size_t to grpc_slice;

GRPCAPI int grpc_header_key_is_legal(grpc_slice slice);

Thus c2hs expects two arguments in the C function, but there was only one.
Naturally c2hs needs to fail generating the bindings, but the failure should be informative.

@deech
Copy link
Contributor

deech commented Mar 6, 2017

I am unable to upload to Hackage.
upload-failed

@ian-ross Can you add me to the Hackage group?

@ian-ross
Copy link
Member

ian-ross commented Mar 6, 2017

@deech Just tried to add you. Do you get some sort of email when I do that? Because you're not just appearing on the maintainers list when I add you (username deech, I guess?).

@deech
Copy link
Contributor

deech commented Mar 6, 2017

I haven't yet. Just refreshed the Hackage page and I don't see my email address listed.

@ian-ross
Copy link
Member

ian-ross commented Mar 6, 2017

Hmmm. Maybe the web form for adding maintainers doesn't work. Let me just pull from the repo, add you to the maintainers list in the Cabal file and do an upload. That might work better. Just give me a minute...

@ian-ross
Copy link
Member

ian-ross commented Mar 6, 2017

OK, I've just uploaded 0.28.2 with you added to the maintainers list in the Cabal file. It doesn't make editing the maintainers list in the web form work any better though...

@deech
Copy link
Contributor

deech commented Mar 6, 2017

Ok, I see the version up there with my email address. Let's see if it works on the next release. Thanks!

@deech deech closed this as completed Mar 6, 2017
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

No branches or pull requests

3 participants