From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elena Zannoni To: Kevin Buettner Cc: Elena Zannoni , gdb@sources.redhat.com Subject: Re: Question--EXTERN: good or bad (or neutral)? Date: Wed, 01 Aug 2001 18:26:00 -0000 Message-id: <15208.44527.611391.853209@krustylu.cygnus.com> References: <15208.34467.908215.907865@krustylu.cygnus.com> <1010801225802.ZM11135@ocotillo.lan> X-SW-Source: 2001-08/msg00015.html Kevin Buettner writes: > On Aug 1, 6:45pm, Elena Zannoni wrote: > > > How do people feel about this thing in buildsym.h? > > Is there any reason for not moving the definitions into the .c files? > > If you *really* need lots of global variables, the EXTERN trickery > could be a good thing because it could make maintenance easier. I.e, > when you want to change one of the types, it would only need to be > changed in one spot and you don't have diverging comments, etc. > > However, I think we're taking the viewpoint these days that macro > trickery like the above is bad style. In addition, we shouldn't be > defining that many global variables anyway. In fact, we *should* be > attempting to eliminate as many of these globals as we can. So, I see > nothing wrong with making these globals more painful to use and > maintain. That way, when one of us wants to change one of these, > perhaps we'll take a look at the code and find a way to do the same > job without the global. Yes, I haven't actually even looked at how many of these globals need to be exported. Maybe it is the case that only a few are actually necessary in the .h file. > > (So, yes, I think moving the definitions into a .c file is a good idea.) > Yeah. Lots of low hanging fruits in those files. > Kevin Elena