diff --git a/Network.hs b/Network.hs
--- a/Network.hs
+++ b/Network.hs
@@ -273,7 +273,7 @@
              (HostEntry peer _ _ _) <- getHostByAddr AF_INET haddr
              return peer
           )
-          (\e -> inet_ntoa haddr)
+          (\_e -> inet_ntoa haddr)
                 -- if getHostByName fails, we fall back to the IP address
  handle <- socketToHandle sock' ReadWriteMode
  return (handle, peer, port)
@@ -287,7 +287,6 @@
 # if !defined(mingw32_HOST_OS) && !defined(cygwin32_HOST_OS) && !defined(_WIN32)
                  SockAddrUnix      a   -> return a
 # endif
-                 a                     -> return (show a)
  handle <- socketToHandle sock' ReadWriteMode
  let port = case addr of
               SockAddrInet  p _     -> p
@@ -301,7 +300,7 @@
  handle <- socketToHandle sock' ReadWriteMode
  return (handle, path, -1)
 #endif
-accept sock@(MkSocket _ family _ _ _) =
+accept (MkSocket _ family _ _ _) =
   error $ "Sorry, address family " ++ (show family) ++ " is not supported!"
 
 -- -----------------------------------------------------------------------------
@@ -396,7 +395,6 @@
 -- ---------------------------------------------------------------------------
 -- Utils
 
-#if __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < 606
 -- Like bracket, but only performs the final action if there was an 
 -- exception raised by the middle bit.
 bracketOnError
@@ -404,6 +402,7 @@
         -> (a -> IO b)  -- ^ computation to run last (\"release resource\")
         -> (a -> IO c)  -- ^ computation to run in-between
         -> IO c         -- returns the value from the in-between computation
+#if __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < 606
 bracketOnError before after thing =
   Exception.block (do
     a <- before
diff --git a/Network/BSD.hsc b/Network/BSD.hsc
--- a/Network/BSD.hsc
+++ b/Network/BSD.hsc
@@ -98,9 +98,10 @@
 
 import Control.Concurrent (MVar, newMVar, withMVar)
 import Control.Exception (catch)
-import Foreign.C.Error (throwErrnoIfMinus1, throwErrnoIfMinus1_)
-import Foreign.C.String (CString, peekCString, peekCStringLen, withCString)
-import Foreign.C.Types ( CChar, CShort )
+import Foreign.C.String (CString, peekCString, withCString)
+#if defined(HAVE_WINSOCK2_H) && !defined(cygwin32_HOST_OS)
+import Foreign.C.Types ( CShort )
+#endif
 #if __GLASGOW_HASKELL__ >= 703
 import Foreign.C.Types ( CInt(..), CULong(..), CSize(..) )
 #else
@@ -176,7 +177,7 @@
                         serviceProtocol = s_proto
                 })
 
-   poke p = error "Storable.poke(BSD.ServiceEntry) not implemented"
+   poke _p = error "Storable.poke(BSD.ServiceEntry) not implemented"
 
 
 -- | Get service by name.
@@ -278,7 +279,7 @@
                         protoNumber  = p_proto
                 })
 
-   poke p = error "Storable.poke(BSD.ProtocolEntry) not implemented"
+   poke _p = error "Storable.poke(BSD.ProtocolEntry) not implemented"
 
 getProtocolByName :: ProtocolName -> IO ProtocolEntry
 getProtocolByName name = withLock $ do
@@ -367,7 +368,7 @@
                         hostAddresses  = h_addr_list
                 })
 
-   poke p = error "Storable.poke(BSD.ServiceEntry) not implemented"
+   poke _p = error "Storable.poke(BSD.ServiceEntry) not implemented"
 
 
 -- convenience function:
@@ -468,7 +469,7 @@
                         networkAddress   = n_net
                 })
 
-   poke p = error "Storable.poke(BSD.NetEntry) not implemented"
+   poke _p = error "Storable.poke(BSD.NetEntry) not implemented"
 
 
 #if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32)
@@ -567,8 +568,10 @@
 --   That failure may very well be due to WinSock not being initialised,
 --   so if NULL is seen try init'ing and repeat the call.
 #if !defined(mingw32_HOST_OS) && !defined(_WIN32)
+trySysCall :: IO a -> IO a
 trySysCall act = act
 #else
+trySysCall :: IO (Ptr a) -> IO (Ptr a)
 trySysCall act = do
   ptr <- act
   if (ptr == nullPtr)
diff --git a/Network/Socket.hsc b/Network/Socket.hsc
--- a/Network/Socket.hsc
+++ b/Network/Socket.hsc
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+{-# OPTIONS_GHC -fno-warn-orphans -fno-warn-unused-do-bind #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Network.Socket
@@ -176,12 +177,11 @@
 
 import Data.Bits
 import Data.List (foldl')
-import Data.Word (Word8, Word16, Word32)
-import Foreign.Ptr (Ptr, castPtr, nullPtr, plusPtr)
+import Data.Word (Word16, Word32)
+import Foreign.Ptr (Ptr, castPtr, nullPtr)
 import Foreign.Storable (Storable(..))
 import Foreign.C.Error
-import Foreign.C.String (CString, withCString, peekCString, peekCStringLen,
-                        castCharToCChar)
+import Foreign.C.String (CString, withCString, peekCString, peekCStringLen)
 import Foreign.C.Types (CUInt, CChar)
 #if __GLASGOW_HASKELL__ >= 703
 import Foreign.C.Types (CInt(..), CSize(..))
@@ -189,7 +189,7 @@
 import Foreign.C.Types (CInt, CSize)
 #endif
 import Foreign.Marshal.Alloc ( alloca, allocaBytes )
-import Foreign.Marshal.Array ( peekArray, pokeArray, pokeArray0 )
+import Foreign.Marshal.Array ( peekArray )
 import Foreign.Marshal.Utils ( maybeWith, with )
 
 import System.IO
@@ -312,7 +312,7 @@
   (MkSocket _ _ _ _ m1) == (MkSocket _ _ _ _ m2) = m1 == m2
 
 instance Show Socket where
-  showsPrec n (MkSocket fd _ _ _ _) = 
+  showsPrec _n (MkSocket fd _ _ _ _) =
         showString "<socket: " . shows fd . showString ">"
 
 
@@ -424,7 +424,14 @@
     socket_status <- newMVar NotConnected
     let sock = MkSocket fd family stype protocol socket_status
 #if HAVE_DECL_IPV6_V6ONLY
+# if defined(mingw32_HOST_OS)
+    -- the IPv6Only option is only supported on Windows Vista and later,
+    -- so trying to change it might throw an error
+    when (family == AF_INET6) $
+            catchIOError (setSocketOption sock IPv6Only 0) $ const $ return ()
+# else
     when (family == AF_INET6) $ setSocketOption sock IPv6Only 0
+# endif
 #endif
     return sock
 
@@ -439,16 +446,16 @@
            -> IO (Socket, Socket) -- unnamed and connected.
 socketPair family stype protocol = do
     allocaBytes (2 * sizeOf (1 :: CInt)) $ \ fdArr -> do
-    rc <- throwSocketErrorIfMinus1Retry "socketpair" $
+    _rc <- throwSocketErrorIfMinus1Retry "socketpair" $
                 c_socketpair (packFamily family)
                              (packSocketType stype)
                              protocol fdArr
     [fd1,fd2] <- peekArray 2 fdArr 
-    s1 <- mkSocket fd1
-    s2 <- mkSocket fd2
+    s1 <- mkNonBlockingSocket fd1
+    s2 <- mkNonBlockingSocket fd2
     return (s1,s2)
   where
-    mkSocket fd = do
+    mkNonBlockingSocket fd = do
 #if !defined(__HUGS__)
 # if __GLASGOW_HASKELL__ < 611
        System.Posix.Internals.setNonBlockingFD fd
@@ -482,7 +489,7 @@
          show status))
   else do
    withSockAddr addr $ \p_addr sz -> do
-   status <- throwSocketErrorIfMinus1Retry "bind" $ c_bind s p_addr (fromIntegral sz)
+   _status <- throwSocketErrorIfMinus1Retry "bind" $ c_bind s p_addr (fromIntegral sz)
    return Bound
 
 -----------------------------------------------------------------------------
@@ -511,7 +518,7 @@
                      _ | err == eINTR       -> connectLoop
                      _ | err == eINPROGRESS -> connectBlocked
 --                   _ | err == eAGAIN      -> connectBlocked
-                     otherwise              -> throwSocketError "connect"
+                     _otherwise             -> throwSocketError "connect"
 #else
                    rc <- c_getLastError
                    case rc of
@@ -668,7 +675,7 @@
           -> Ptr a -> Int  -- Data to send
           -> SockAddr
           -> IO Int            -- Number of Bytes sent
-sendBufTo (MkSocket s _family _stype _protocol status) ptr nbytes addr = do
+sendBufTo (MkSocket s _family _stype _protocol _status) ptr nbytes addr = do
  withSockAddr addr $ \p_addr sz -> do
    liftM fromIntegral $
 #if !defined(__HUGS__)
@@ -702,7 +709,7 @@
 -- NOTE: blocking on Windows unless you compile with -threaded (see
 -- GHC ticket #1129)
 recvBufFrom :: Socket -> Ptr a -> Int -> IO (Int, SockAddr)
-recvBufFrom sock@(MkSocket s family _stype _protocol status) ptr nbytes
+recvBufFrom sock@(MkSocket s family _stype _protocol _status) ptr nbytes
  | nbytes <= 0 = ioError (mkInvalidRecvArgError "Network.Socket.recvFrom")
  | otherwise   = 
     withNewSockAddr family $ \ptr_addr sz -> do
@@ -739,7 +746,7 @@
 send :: Socket  -- Bound/Connected Socket
      -> String  -- Data to send
      -> IO Int  -- Number of Bytes sent
-send sock@(MkSocket s _family _stype _protocol status) xs = do
+send sock@(MkSocket s _family _stype _protocol _status) xs = do
  let len = length xs
  withCString xs $ \str -> do
    liftM fromIntegral $
@@ -784,7 +791,7 @@
 recv sock l = recvLen sock l >>= \ (s,_) -> return s
 
 recvLen :: Socket -> Int -> IO (String, Int)
-recvLen sock@(MkSocket s _family _stype _protocol status) nbytes 
+recvLen sock@(MkSocket s _family _stype _protocol _status) nbytes
  | nbytes <= 0 = ioError (mkInvalidRecvArgError "Network.Socket.recv")
  | otherwise   = do
      allocaBytes nbytes $ \ptr -> do
@@ -808,8 +815,8 @@
         if len' == 0
          then ioError (mkEOFError "Network.Socket.recv")
          else do
-           s <- peekCStringLen (castPtr ptr,len')
-           return (s, len')
+           s' <- peekCStringLen (castPtr ptr,len')
+           return (s', len')
 
 -- ---------------------------------------------------------------------------
 -- socketPort
@@ -846,7 +853,7 @@
  withNewSockAddr family $ \ptr sz -> do
    with (fromIntegral sz) $ \int_star -> do
    throwSocketErrorIfMinus1Retry "getPeerName" $ c_getpeername s ptr int_star
-   sz <- peek int_star
+   _sz <- peek int_star
    peekSockAddr ptr
     
 getSocketName :: Socket -> IO SockAddr
@@ -924,7 +931,7 @@
 #if HAVE_DECL_IPV6_V6ONLY
     | IPv6Only      {- IPV6_V6ONLY -}
 #endif
-    deriving Typeable
+    deriving (Show, Typeable)
 
 socketOptLevel :: SocketOption -> CInt
 socketOptLevel so = 
@@ -1009,6 +1016,8 @@
 #if HAVE_DECL_IPV6_V6ONLY
     IPv6Only      -> #const IPV6_V6ONLY
 #endif
+    unknown       -> error ("Network.Socket.packSocketOption: unknown option " ++
+                            show unknown)
 
 setSocketOption :: Socket 
                 -> SocketOption -- Option Name
@@ -1120,11 +1129,11 @@
             (threadWaitRead (fromIntegral fd)) $
 #endif
             c_recvAncillary fd ptr_lev ptr_ty (fromIntegral flags) ptr_pData ptr_len
-      len <- fromIntegral `liftM` peek ptr_len
+      rcvlen <- fromIntegral `liftM` peek ptr_len
       lev <- fromIntegral `liftM` peek ptr_lev
       ty  <- fromIntegral `liftM` peek ptr_ty
       pD  <- peek ptr_pData
-      return (lev,ty,pD, len)
+      return (lev,ty,pD, rcvlen)
 foreign import ccall SAFE_ON_WIN "sendAncillary"
   c_sendAncillary :: CInt -> CInt -> CInt -> CInt -> Ptr a -> CInt -> IO CInt
 
@@ -1636,6 +1645,7 @@
 #ifdef SOCK_SEQPACKET
         (#const SOCK_SEQPACKET) -> SeqPacket
 #endif
+        _ -> NoSocketType
 
 -- ---------------------------------------------------------------------------
 -- Utility Functions
@@ -1799,7 +1809,7 @@
 -- that each value can cause exactly one bit to be set; unpackBits will
 -- break if this property is not true.
 
-packBits :: (Eq a, Bits b) => [(a, b)] -> [a] -> b
+packBits :: (Eq a, Num b, Bits b) => [(a, b)] -> [a] -> b
 
 packBits mapping xs = foldl' pack 0 mapping
     where pack acc (k, v) | k `elem` xs = acc .|. v
@@ -1807,7 +1817,7 @@
 
 -- | Unpack a bitmask into a list of values.
 
-unpackBits :: Bits b => [(a, b)] -> b -> [a]
+unpackBits :: (Num b, Bits b) => [(a, b)] -> b -> [a]
 
 -- Be permissive and ignore unknown bit values. At least on OS X,
 -- getaddrinfo returns an ai_flags field with bits set that have no
@@ -2197,12 +2207,13 @@
   c_connect :: CInt -> Ptr SockAddr -> CInt{-CSockLen???-} -> IO CInt
 foreign import CALLCONV unsafe "accept"
   c_accept :: CInt -> Ptr SockAddr -> Ptr CInt{-CSockLen???-} -> IO CInt
-foreign import CALLCONV safe "accept"
-  c_accept_safe :: CInt -> Ptr SockAddr -> Ptr CInt{-CSockLen???-} -> IO CInt
 foreign import CALLCONV unsafe "listen"
   c_listen :: CInt -> CInt -> IO CInt
 
-#ifdef __GLASGOW_HASKELL__
+#if defined(mingw32_HOST_OS) && defined(__GLASGOW_HASKELL__)
+foreign import CALLCONV safe "accept"
+  c_accept_safe :: CInt -> Ptr SockAddr -> Ptr CInt{-CSockLen???-} -> IO CInt
+
 foreign import ccall "rtsSupportsBoundThreads" threaded :: Bool
 #endif
 
diff --git a/Network/Socket/Internal.hsc b/Network/Socket/Internal.hsc
--- a/Network/Socket/Internal.hsc
+++ b/Network/Socket/Internal.hsc
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP, FlexibleInstances, ForeignFunctionInterface #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Network.Socket.Internal
@@ -100,8 +101,8 @@
 s6_addr_offset = (#offset struct in6_addr, s6_addr)
 
 peek32 :: Ptr a -> Int -> IO Word32
-peek32 p i = do
-    let i' = i * 4
+peek32 p i0 = do
+    let i' = i0 * 4
         peekByte n = peekByteOff p (s6_addr_offset + i' + n) :: IO Word8
         a `sl` i = fromIntegral a `shiftL` i
     a0 <- peekByte 0
@@ -111,10 +112,10 @@
     return ((a0 `sl` 24) .|. (a1 `sl` 16) .|. (a2 `sl` 8) .|. (a3 `sl` 0))
 
 poke32 :: Ptr a -> Int -> Word32 -> IO ()
-poke32 p i a = do
-    let i' = i * 4
+poke32 p i0 a = do
+    let i' = i0 * 4
         pokeByte n = pokeByteOff p (s6_addr_offset + i' + n)
-        a `sr` i = fromIntegral (a `shiftR` i) :: Word8
+        x `sr` i = fromIntegral (x `shiftR` i) :: Word8
     pokeByte 0 (a `sr` 24)
     pokeByte 1 (a `sr` 16)
     pokeByte 2 (a `sr`  8)
diff --git a/Network/URI.hs b/Network/URI.hs
--- a/Network/URI.hs
+++ b/Network/URI.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
 --------------------------------------------------------------------------------
 -- |
 --  Module      :  Network.URI
@@ -112,16 +113,15 @@
     ) where
 
 import Text.ParserCombinators.Parsec
-    ( GenParser(..), ParseError(..)
+    ( GenParser, ParseError
     , parse, (<|>), (<?>), try
-    , option, many, many1, count, notFollowedBy, lookAhead
-    , char, satisfy, oneOf, string, letter, digit, hexDigit, eof
+    , option, many, many1, count, notFollowedBy
+    , char, satisfy, oneOf, string, eof
     , unexpected
     )
 
 import Control.Monad (MonadPlus(..))
-import Data.Char (ord, chr, isHexDigit, isSpace, toLower, toUpper, digitToInt)
-import Data.Maybe (isJust)
+import Data.Char (ord, chr, isHexDigit, toLower, toUpper, digitToInt)
 import Debug.Trace (trace)
 import Numeric (showIntAtBase)
 
@@ -209,7 +209,7 @@
 --  data exposed by show.]]]
 --
 instance Show URI where
-    showsPrec _ uri = uriToString defaultUserInfoMap uri
+    showsPrec _ = uriToString defaultUserInfoMap
 
 defaultUserInfoMap :: String -> String
 defaultUserInfoMap uinf = user++newpass
@@ -220,6 +220,7 @@
                         then pass
                         else ":...@"
 
+testDefaultUserInfoMap :: [Bool]
 testDefaultUserInfoMap =
      [ defaultUserInfoMap ""                == ""
      , defaultUserInfoMap "@"               == "@"
@@ -319,7 +320,7 @@
 isValidParse parser uristr = case parseAll parser "" uristr of
         -- Left  e -> error (show e)
         Left  _ -> False
-        Right u -> True
+        Right _ -> True
 
 parseAll :: URIParser a -> String -> String -> Either ParseError a
 parseAll parser filename uristr = parse newparser filename uristr
@@ -359,8 +360,10 @@
 isReserved :: Char -> Bool
 isReserved c = isGenDelims c || isSubDelims c
 
+isGenDelims :: Char -> Bool
 isGenDelims c = c `elem` ":/?#[]@"
 
+isSubDelims :: Char -> Bool
 isSubDelims c = c `elem` "!$&'()*+,;="
 
 genDelims :: URIParser String
@@ -479,6 +482,7 @@
         ; return $ 'c':h:'.':a
         }
 
+isIpvFutureChar :: Char -> Bool
 isIpvFutureChar c = isUnreserved c || isSubDelims c || (c==';')
 
 ipv6address :: URIParser String
@@ -579,7 +583,7 @@
 decOctet :: URIParser String
 decOctet =
     do  { a1 <- countMinMax 1 3 digitChar
-        ; if read a1 > 255 then
+        ; if (read a1 :: Integer) > 255 then
             fail "Decimal octet value too large"
           else
             return a1
@@ -787,14 +791,19 @@
     --    certainly be allowed.
     -- ]]]
 
+isAlphaChar :: Char -> Bool
 isAlphaChar c    = (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')
 
+isDigitChar :: Char -> Bool
 isDigitChar c    = (c >= '0' && c <= '9')
 
+isAlphaNumChar :: Char -> Bool
 isAlphaNumChar c = isAlphaChar c || isDigitChar c
 
+isHexDigitChar :: Char -> Bool
 isHexDigitChar c = isHexDigit c
 
+isSchemeChar :: Char -> Bool
 isSchemeChar c   = (isAlphaNumChar c) || (c `elem` "+-.")
 
 alphaChar :: URIParser Char
@@ -847,25 +856,25 @@
 --  to preserve the password in the formatted output.
 --
 uriToString :: (String->String) -> URI -> ShowS
-uriToString userinfomap URI { uriScheme=scheme
-                            , uriAuthority=authority
-                            , uriPath=path
-                            , uriQuery=query
-                            , uriFragment=fragment
+uriToString userinfomap URI { uriScheme=myscheme
+                            , uriAuthority=myauthority
+                            , uriPath=mypath
+                            , uriQuery=myquery
+                            , uriFragment=myfragment
                             } =
-    (scheme++) . (uriAuthToString userinfomap authority)
-               . (path++) . (query++) . (fragment++)
+    (myscheme++) . (uriAuthToString userinfomap myauthority)
+               . (mypath++) . (myquery++) . (myfragment++)
 
 uriAuthToString :: (String->String) -> (Maybe URIAuth) -> ShowS
 uriAuthToString _           Nothing   = id          -- shows ""
 uriAuthToString userinfomap
-        (Just URIAuth { uriUserInfo = uinfo
-                      , uriRegName  = regname
-                      , uriPort     = port
+        (Just URIAuth { uriUserInfo = myuinfo
+                      , uriRegName  = myregname
+                      , uriPort     = myport
                       } ) =
-    ("//"++) . (if null uinfo then id else ((userinfomap uinfo)++))
-             . (regname++)
-             . (port++)
+    ("//"++) . (if null myuinfo then id else ((userinfomap myuinfo)++))
+             . (myregname++)
+             . (myport++)
 
 ------------------------------------------------------------
 --  Character classes
@@ -896,7 +905,7 @@
         myShowHex :: Int -> ShowS
         myShowHex n r =  case showIntAtBase 16 (toChrHex) n r of
             []  -> "00"
-            [c] -> ['0',c]
+            [x] -> ['0',x]
             cs  -> cs
         toChrHex d
             | d < 10    = chr (ord '0' + fromIntegral d)
@@ -1000,17 +1009,12 @@
 elimDots [] rs = concat (reverse rs)
 elimDots (    '.':'/':ps)     rs = elimDots ps rs
 elimDots (    '.':[]    )     rs = elimDots [] rs
-elimDots (    '.':'.':'/':ps) rs = elimDots ps (dropHead rs)
-elimDots (    '.':'.':[]    ) rs = elimDots [] (dropHead rs)
+elimDots (    '.':'.':'/':ps) rs = elimDots ps (drop 1 rs)
+elimDots (    '.':'.':[]    ) rs = elimDots [] (drop 1 rs)
 elimDots ps rs = elimDots ps1 (r:rs)
     where
         (r,ps1) = nextSegment ps
 
---  Return tail of non-null list, otherwise return null list
-dropHead :: [a] -> [a]
-dropHead []     = []
-dropHead (r:rs) = rs
-
 --  Returns the next segment and the rest of the path from a path string.
 --  Each segment ends with the next '/' or the end of string.
 --
@@ -1022,9 +1026,9 @@
 
 --  Split last (name) segment from path, returning (path,name)
 splitLast :: String -> (String,String)
-splitLast path = (reverse revpath,reverse revname)
+splitLast p = (reverse revpath,reverse revname)
     where
-        (revname,revpath) = break (=='/') $ reverse path
+        (revname,revpath) = break (=='/') $ reverse p
 
 ------------------------------------------------------------
 -- Finding a URI relative to a base URI
@@ -1080,7 +1084,7 @@
                 (p1,p2) = splitLast p
 
 relPathFrom :: String -> String -> String
-relPathFrom []   base = "/"
+relPathFrom []   _    = "/"
 relPathFrom pabs []   = pabs
 relPathFrom pabs base =                 -- Construct a relative path segments
     if sa1 == sb1                       -- if the paths share a leading segment
@@ -1112,7 +1116,7 @@
                   else
                       rp++na
         -- Precede name with some path if it is null or contains a ':'
-        protect na = null na || ':' `elem` na
+        protect s = null s || ':' `elem` s
 
 --  relSegsFrom discards any common leading segments from both paths,
 --  then invokes difSegsFrom to calculate a relative path from the end
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -1713,6 +1713,8 @@
 #endif
 #ifdef HAVE_WS2TCPIP_H
 # include <ws2tcpip.h>
+// fix for MingW not defining IPV6_V6ONLY
+# define IPV6_V6ONLY 27
 #endif
 #ifdef HAVE_WSPIAPI_H
 # include <wspiapi.h>
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -9,6 +9,8 @@
 #endif
 #ifdef HAVE_WS2TCPIP_H
 # include <ws2tcpip.h>
+// fix for MingW not defining IPV6_V6ONLY
+# define IPV6_V6ONLY 27
 #endif
 #ifdef HAVE_WSPIAPI_H
 # include <wspiapi.h>
diff --git a/include/HsNet.h b/include/HsNet.h
--- a/include/HsNet.h
+++ b/include/HsNet.h
@@ -40,6 +40,8 @@
 #include <winsock2.h>
 # ifdef HAVE_WS2TCPIP_H
 #  include <ws2tcpip.h>
+// fix for MingW not defining IPV6_V6ONLY
+#  define IPV6_V6ONLY 27
 # endif
 # ifdef HAVE_WSPIAPI_H
 #  include <wspiapi.h>
diff --git a/include/HsNetworkConfig.h b/include/HsNetworkConfig.h
--- a/include/HsNetworkConfig.h
+++ b/include/HsNetworkConfig.h
@@ -133,13 +133,13 @@
 #define PACKAGE_NAME "Haskell network package"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "Haskell network package 2.3.0.10"
+#define PACKAGE_STRING "Haskell network package 2.3.0.11"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "network"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "2.3.0.10"
+#define PACKAGE_VERSION "2.3.0.11"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
diff --git a/network.cabal b/network.cabal
--- a/network.cabal
+++ b/network.cabal
@@ -1,5 +1,5 @@
 name:           network
-version:        2.3.0.11
+version:        2.3.0.12
 license:        BSD3
 license-file:   LICENSE
 maintainer:     Johan Tibell <johan.tibell@gmail.com>
diff --git a/tests/Simple.hs b/tests/Simple.hs
--- a/tests/Simple.hs
+++ b/tests/Simple.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE ScopedTypeVariables #-}
+{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
 
 module Main where
 
@@ -7,7 +8,6 @@
 import Control.Exception (SomeException, bracket, catch, throwTo)
 import qualified Data.ByteString as S
 import qualified Data.ByteString.Char8 as C
-import qualified Data.ByteString.Lazy.Char8 as L
 import Network.Socket hiding (recv, recvFrom, send, sendTo)
 import Network.Socket.ByteString
 import Prelude hiding (catch)
@@ -119,6 +119,7 @@
 ------------------------------------------------------------------------
 -- List of all tests
 
+basicTests :: Test
 basicTests = testGroup "Basic socket operations"
     [
       -- Sending and receiving
diff --git a/tests/uri001.hs b/tests/uri001.hs
--- a/tests/uri001.hs
+++ b/tests/uri001.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
 --------------------------------------------------------------------------------
 --  $Id: URITest.hs,v 1.8 2005/07/19 22:01:27 gklyne Exp $
 --
@@ -40,9 +41,7 @@
 
 import Test.HUnit
 
-import Control.Monad (when)
 import Data.Maybe (fromJust)
-import System.Exit (exitFailure)
 import System.IO (openFile, IOMode(WriteMode), hClose)
 import qualified Test.Framework as TF
 import qualified Test.Framework.Providers.HUnit as TF
@@ -1197,7 +1196,7 @@
 
 runTestFile t = do
     h <- openFile "a.tmp" WriteMode
-    runTestText (putTextToHandle h False) t
+    _ <- runTestText (putTextToHandle h False) t
     hClose h
 tf = runTestFile
 tt = runTestTT
