"Standard C" available in cabal package

Hi, I see that cabal allows me to say: c-sources: (...) and then have a few C files built with my program. I see that I can have lines like #include <some usual C header> in those files, and that makes me think that, even if I add no C files to my .cabal, I still can count on what would be standard C functions available, and that I could use them with Foreign, like, say: foreign import ccall "memcpy" :: Ptr a -> Ptr a -> CSize -> IO Ptr a Am I right to guess that? If so, what would be the available set of functions? I imagined standard C (C99?), but searching around I see that there are a few different stabdard C libraries, like, for instance, glibc, which seems to be used in Linux, and a few others. Supposed I wanted to write a module with all C functions always available, what could I let be there? Thanks, Maurício

Maur____cio
Supposed I wanted to write a module with all C functions always available, what could I let be there?
POSIX? -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.

Maur____cio
Achim Schneider a __crit :
Maur____cio
wrote: Supposed I wanted to write a module with all C functions always available, what could I let be there?
POSIX?
Is that portable for non-unix? I think cabal does work on some non-unix systems.
Even windows provides POSIX, it's _the_ C standard. If you are going to find a common set of C functions, that'll be it. Don't expect windows to have a fifo or block file type, though. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.

On Fri, Jan 30, 2009 at 09:40:02PM +0100, Achim Schneider wrote:
POSIX?
Is that portable for non-unix? I think cabal does work on some non-unix systems.
Even windows provides POSIX, it's _the_ C standard. If you are going to find a common set of C functions, that'll be it. Don't expect windows to have a fifo or block file type, though.
Sorry, but the standard libraries defined by all the C standards are just a small subset of POSIX. If you want to be portable beyond POSIX compliant systems, you've to stick to something like C99.
participants (3)
-
Achim Schneider
-
Matthias Kilian
-
Maurício