Subject: Re: Where is random()?
From: [email-masked] (Fergus Henderson)

15 Dec 1998 22:44:34 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
To: Mumit Khan <[email-masked]>
Cc: Jan Tomasek <[email-masked]>,
        "[email-masked]" <[email-masked]>

On 14-Dec-1998, Mumit Khan <[email-masked]> wrote:
> Jan Tomasek <[email-masked]> writes:
> > Hi,
> > I'm writing one school project in C and at home I working
> > under CygWin 19.2 
> > 
> > On my Linux (Debian) is on random() man page writen that it is in
> > defined in stdlib.h
> >  * if I compile it with gcc on that linux all is ok
> >  * if I compile it with Cygnus gcc port I get warning:
> 
> Learning standard from man pages is as full of pitfalls as learning a new
> evolving computer language from a compiler.

This is true.  However, if you're going to choose a set of man pages
to learn from, the Debian Linux ones are actually not too bad, because
most of the man pages have a "CONFORMING TO" section which states
which standard(s) support the function(s) in question. 

> `random' is not standard ANSI nor is it part of POSIX.

Right.  For random(), the Debian Linux man page states the following:

	CONFORMING TO
	       BSD 4.3

Cygwin provides ANSI C, most of POSIX.1/1990, and some other stuff.
For details, see the "What Unix API calls are supported by Cygwin?"
section of the FAQ list.

> The good news for you is that Cygwin comes with libiberty, which contains 
> a random function. Just add -liberty at the end of the list of libraries
> when you link and you're set for now.

BTW, the FAQ list says that Cygwin supports random() but doesn't
mention the need to link in libiberty.

-- 
Fergus Henderson <[email-masked]>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger [email-masked]        |     -- leaked Microsoft memo.
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".