swarm-support
[Top][All Lists]
Advanced

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

Re: Re-compiling app with 2.0.1: warnings


From: Marcus G. Daniels
Subject: Re: Re-compiling app with 2.0.1: warnings
Date: 24 Sep 1999 09:41:24 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "FM" == Fabio Mascelloni <address@hidden> writes:

FM> 1) '' unused variable '<var-name>'

If you have dead code, but want to keep it there as an alternative
configuration or for documenting past approaches, you can wrap all 
that code in something like this:

#ifdef OLDCONFIG
id unusedVariable;
#endif

Then you can add that code back with a "#define OLDCONFIG" or a 
-DOLDCONFIG on the command line.

FM> 2) '' '<var-name>' might be used uninitialized in this function
FM> ''        ( harmless warning too)

These can have bad consequences.  Often there's the situation where
you have some main chunk of code that runs while your testing
new code, and some corner cases that run when the model runs.  If you
overlook initialization of the all the variables as they apply
in every case, you can get incorrect output.

FM> 3) " implicit declaration of function '<function-name>'

This you should fix.  It is important that the compiler know all the
functions and methods you use have their arguments and return type.  Otherwise
the compiler can generate inappropriate code for when they are called.

FM>          Common.h : <line-number> : multiple definition of
FM> function '<function-name>'

If you have the situation where you want to have a function defined
in a header file, it should be tagged "static" or "static inline" so that
this won't occur.  You'll get duplicates, though.  The GCC manual describes
these issues in detail.

FM>   4)   " libtool-swarm :link:warning: library
FM> '/Swarm-2.0.1/lib/libspace.la' was moved"

Just remove -lspace from your Makefile.  It is part of the Swarm DLL.

                  ==================================
   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]