Re: [CODE] Better argument processing

From: Sammy (samedi@DHC.NET)
Date: 09/19/97


On Fri, 19 Sep 1997, Andrew Helm wrote:

> It looks good, but is it safe? Can you return a pointer to a static
> variable in the function? (Or rather, not "can" you, but is it going
> to mess up any compilers/platforms, that is, is such a thing okay
> in ANSI C?).

As someone pointed out a week or two ago, some libc functions (asctime was
the one I think) return a pointer to a static char array.  That's one of
the main reasons most libraries aren't thread-safe, but if you aren't
using threads, it's perfectly ok as long as you act on the result before
calling the function again.

Sam


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST