This is the mail archive of the
insight@sourceware.cygnus.com
mailing list for the Insight project.
Warnings
- To: insight at sourceware dot cygnus dot com
- Subject: Warnings
- From: Duane Ellis <duane at franklin dot com>
- Date: Thu, 18 Nov 1999 10:35:31 -0500
- Reply-to: duane at franklin dot com
Here at Franklin, we have an internal requirement that *ALL* code we write
is compiles with no warnings or errors and with these options:
-Wall -Wmissing-prototypes -Wstrict-prototypes
and in most cases, -Werror also.
The *ONLY* exception to the -Werror is when there is a problem system
header file that issues warnings. {ie: X window header files)
One thing that always shows up when building Insight - and it's many
tools is this warning/error:
utils.c:2938: warning: unused parameter `arg'
utils.c:2939: warning: unused parameter `from_tty'
There are *LOTS* of these, sorting through *THESE* warnings and other
warnings/problems that I am introducing is a real P.I.T.A.
------------------------------------------------------------
We have a standard way of getting rid of this here.
Add the following to "defs.h"
#define GDB_UNUSED_PARM( NAME ) (void)(NAME)
Then, in function in this example in utils.c" would look like this:
static void
pagination_off_command (arg, from_tty)
char *arg;
int from_tty;
{
GDB_UNUSED_PARAM( arg );
GDB_UNUSED_PARAM( from_tty );
pagination_enabled = 0;
}
------------------------------------------------------------
Have you guys thought of adding these changes to Insight?
-Duane.