This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Question--EXTERN: good or bad (or neutral)?



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]