[project @ 1999-01-23 17:40:07 by sof]
authorsof <unknown>
Sat, 23 Jan 1999 17:40:07 +0000 (17:40 +0000)
committersof <unknown>
Sat, 23 Jan 1999 17:40:07 +0000 (17:40 +0000)
Tag all 'foreign import's as being unsafe.

ghc/lib/std/System.lhs

index f94ee48..0b01d5a 100644 (file)
@@ -98,7 +98,7 @@ getEnv name = do
         else ioError (IOError Nothing NoSuchThing "getEnv"
                        ("environment variable: " ++ name))
 
-foreign import ccall "libHS_cbits.so" "getenv" primGetEnv :: PrimByteArray -> IO Addr
+foreign import ccall "libHS_cbits.so" "getenv" unsafe primGetEnv :: PrimByteArray -> IO Addr
 \end{code}
 
 Computation $system cmd$ returns the exit code
@@ -124,7 +124,7 @@ system cmd = do
         -1 -> constructErrorAndFailWithInfo "system" cmd
         n  -> return (ExitFailure n)
 
-foreign import ccall "libHS_cbits.so" "systemCmd" primSystem :: PrimByteArray -> IO Int
+foreign import ccall "libHS_cbits.so" "systemCmd" unsafe primSystem :: PrimByteArray -> IO Int
 \end{code}
 
 @exitWith code@ terminates the program, returning {\em code} to the program's caller.
@@ -142,7 +142,7 @@ exitWith (ExitFailure n)
     primExit n
     ioError (IOError Nothing OtherError "exitWith" "exit should not return")
 
-foreign import ccall "libHS_cbits.so" "exit" primExit :: Int -> IO ()
+foreign import ccall "libHS_cbits.so" "exit" unsafe primExit :: Int -> IO ()
 
 exitFailure :: IO a
 exitFailure = exitWith (ExitFailure 1)