This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Question--EXTERN: good or bad (or neutral)?
- To: gdb at sources dot redhat dot com
- Subject: Question--EXTERN: good or bad (or neutral)?
- From: Elena Zannoni <ezannoni at cygnus dot com>
- Date: Wed, 1 Aug 2001 18:45:55 -0400
How do people feel about this thing in buildsym.h?
/* [...]
Variables declared in this file can be defined by #define-ing the
name EXTERN to null. It is used to declare variables that are
normally extern, but which get defined in a single module using
this technique. */
#ifndef EXTERN
#define EXTERN extern
#endif
buildsym.c does this:
/* Ask buildsym.h to define the vars it normally declares `extern'. */
#define EXTERN
/**/
#include "buildsym.h" /* Our own declarations */
#undef EXTERN
while the other files that need those variables, simply include
buildsym.h w/o redefining EXTERN.
Same thing occurs with stabsread.h and stabsread.c.
Is there any reason for not moving the definitions into the .c files?
Elena