#3263: Warnings for monadic values not used
---------------------------------+------------------------------------------
Reporter: NeilMitchell | Owner: igloo
Type: feature request | Status: new
Priority: normal | Milestone: 6.12.1
Component: Compiler | Version: 6.10.2
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Changes (by igloo):
* milestone: => 6.12.1
Comment:
I've looked at some of the changes needed to fix base once the new
warnings are on.
There are some suspicious looking things going on in the
`GHC.IO.Encoding.*` modules: `writeCharBuf` returns a new index, which may
be either 1 or 2 beyond the index we're writing to if `CHARBUF_UTF16`, but
we ignore it and just assume 1. Also, the `ow >= os` test looks like it'll
be wrong when we need to write 2 characters. Simon M, am I missing
something?
The `updatingBucket` code also doesn't make sense to me:
{{{
bkts' <- thawArray bkts
writeMutArray bkts' indx bckt'
freezeArray bkts'
}}}
Note that the frozen array is ignored - although currently
{{{
freezeArray = return -- unsafeFreeze
thawArray = return -- unsafeThaw
}}}
so nothing's happening anyway.
There are also a number of C calls that look like they need to be wrapped
in `throwErrnoIfMinus1_` or `throwErrnoIfMinus1Retry_`, e.g.
{{{
hunk ./System/Posix/Internals.hs 243
- c_sigemptyset p_sigset
- c_sigaddset p_sigset const_sigttou
- c_sigprocmask const_sig_block p_sigset p_old_sigset
+ throwErrnoIfMinus1_ "sigemptyset" $ c_sigemptyset p_sigset
+ throwErrnoIfMinus1_ "sigaddset" $ c_sigaddset p_sigset
const_sigttou
+ throwErrnoIfMinus1_ "sigprocmask" $ c_sigprocmask
const_sig_block p_sigset p_old_sigset
hunk ./System/Posix/Internals.hs 249
- c_sigprocmask const_sig_setmask p_old_sigset nullPtr
+ throwErrnoIfMinus1_ "sigprocmask" $ c_sigprocmask
const_sig_setmask p_old_sigset nullPtr
hunk ./System/Posix/Internals.hs 326
- c_fcntl_write fd const_f_setfl (fromIntegral flags')
+ throwErrnoIfMinus1Retry_ "fcntl_write" $ c_fcntl_write fd
const_f_setfl (fromIntegral flags')
hunk ./GHC/Conc.lhs 1085
- c_write (fromIntegral fd) pbuf 1; return ()
+ throwErrnoIfMinus1Retry_ "write" $ c_write (fromIntegral fd) pbuf 1
}}}
For now I've applied the patches that add the warning, but not the library
patches, and I've set
{{{
GhcLibHcOpts += -fno-warn-unused-do-bind
}}}
when validating so the warnings don't make the build fail.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3263#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs