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

Warn when functions are used on unsupported platforms. #24

Closed
wants to merge 1 commit into from

Conversation

JohnLato
Copy link

As requested in #23 .

@hvr hvr added this to the 2.8.0.0 milestone Dec 7, 2014
@dcoutts
Copy link
Contributor

dcoutts commented Dec 7, 2014

I think this is a good idea, but we should make sure the text of the warning explains what the behaviour is. So this is related to the other part of the discussion. For example if we make them throw proper IOErrors of type UnsupportedOperation, then we should make the warning say that, and it should also refer to the appropriate CPP defines if people really need to make compile time decisions on it.

For example, we might have:

"System.Posix.Files.setSymbolicLinkTImesHiRes: not available on this platform. It will throw an 'IOError' exception with error kind 'UnsupportedOperation'. Either catch this exception and provide your own fallback, or to decide at compile-time, use the CPP define HAVE_UTIMENSAT from \"HsUnix.h\"."

@hvr
Copy link
Member

hvr commented Dec 7, 2014

@dcoutts my only concern about that {-# WARNING #-} is how to generate it via CPP or similiar (as it's quite boilerplate-ish), and also how to break it in such a way that we don't have to go over 80 columns in the source-code.

PS: See also 98eced8 where I tried to do something in the spirit of #24 for new functions.

hvr added a commit that referenced this pull request Jan 30, 2016
This follows the scheme suggested in #24

This fixes #55
@hs-viktor
Copy link
Contributor

Closing, rebased and reopened as #178

@hs-viktor hs-viktor closed this Feb 25, 2021
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 this pull request may close these issues.

5 participants