|
[ ghc-Bugs-775969 ] warning: implicit declaration of function foo: msg#00061lang.haskell.glasgow.bugs
Bugs item #775969, was opened at 2003-07-22 23:17 Message generated for change (Comment added) made by simonmar You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=775969&group_id=8032 Category: Compiler (FFI) Group: 6.0 >Status: Closed Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: warning: implicit declaration of function foo Initial Comment: Hi, when I compile a simple program with a function imported from C using -fffi -O, I get the following: warning: implicit declaration of function 'foo' the imported function simply returns its argument multiplied by two. if I compile it without -O option, everything is fine, but with the -O option it gives the warning and when I run the program it gives the wrong result ( 1.0 for any number) Thanks. ---------------------------------------------------------------------- >Comment By: Simon Marlow (simonmar) Date: 2003-07-23 13:49 Message: Logged In: YES user_id=48280 -O implies -fvia-C. When compiling FFI code via C, the C compiler needs to have prototypes in scope for each of the functions you call using the FFI: this is why the C compiler emits the warning about an implicit declaration. The GHC User's Guide describes how to bring the correct prototypes into scope: http://www.haskell.org/ghc/docs/latest/html/users_guide/sec -ffi-ghc.html#GLASGOW-FOREIGN-HEADERS ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=775969&group_id=8032
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-775969 ] warning: implicit declaration of function foo, SourceForge.net |
|---|---|
| Next by Date: | [ ghc-Bugs-769021 ] hsc2hs fails to link intermediate program, SourceForge.net |
| Previous by Thread: | [ ghc-Bugs-775969 ] warning: implicit declaration of function foo, SourceForge.net |
| Next by Thread: | [ ghc-Bugs-437603 ] 5.00.2 build fail on NetBSD/i386, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |