swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a couple of C questions about ASM-objc


From: Marcus G. Daniels
Subject: Re: a couple of C questions about ASM-objc
Date: 16 May 2000 11:00:11 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "PJ" == Paul E Johnson <address@hidden> writes:

PJ> 1. The compiler absolutely hates this in the file error.m: FILE
PJ> *msgfile = stderr;

On some systems, stderr can be an expression.  For example, Cygwin is
like this.  With Hurd, the stdio streams variable expressions invoke
functions.  So that kind of initialization should not be done.

PJ> 2.  when I compile I get the error "getwd is not dangerious and
PJ> should not be used". In the file "util.m" it is used like this:

Right, change to using getcwd.

PJ> So I would rewrite like this?

You shouldn't need the "+ 1" the MAXPATHLEN constant includes it.

PJ> But looking at this code, I can't understand why it would use
PJ> "extern char *getwd( char *); in the first place.  It declares a
PJ> builtin C library function?  And what does extern mean in an "m"
PJ> file?

getcwd can be declared by an "#include <misc.h>". 
Not so long ago, it was not unheard of to declare functions by hand
when the C headers were poor, didn't declare some things, or if there
was a desire to emphasize the independent use of one single feature
apart from a large set of features you get by including a system header file.

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]