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]
Other format: [Raw text]

Re: gas: should duplicate .macro directives be allowed?


On Mon, Mar 07, 2005 at 11:19:17AM -0500, Daniel Jacobowitz wrote:
> On Mon, Mar 07, 2005 at 11:15:02AM -0500, Ian Lance Taylor wrote:
> > "Jan Beulich" <JBeulich@novell.com> writes:
> > 
> > > Yes, the change was deliberate, and I don't think it'd be wise to revert
> > > it (it's simply dangerous considering that you might have these
> > > collisions resulting from two include files, each of which relies on
> > > their definition of the respective macro). Instead, if you need to
> > > override a previous macro definition (and know what you're doing), you
> > > can use easily use .purgem before the new definition (really, I'd rather
> > > recommend not to to catch the collision). Jan
> > 
> > That seems more or less reasonable to me, but Daniel is correct that
> > this change must be mentioned in NEWS.  It should be documented
> > somewhere in as.texinfo as well, if it is not already.
> 
> While I'm wishing, it would be nice if the documentation mentioned
> .purgem somewhere from .macro.  I spent a while trying to figure out if
> there was a right way to do this from the manual, and did not come
> across .purgem until Jan mentioned it.

   Is there merit to issuing a warning on probably inadvertent macro
redefinition? (i.e. Not purged first.) Silent brute-force redefinition
seems very risky, since it depends on fortuitous header include order,
if the preferred macro is to win the invisible contest. Existing code
inadvertently relying on the silent contest would not be broken by a
warning, but the risky programming would be revealed.

   My many macros have not yet collided, but if multiple include files
should ever lead to name conflict, the assembler should warn, because
one macro is in desperate need of renaming or purging, purely through
oversight resulting from increasing complexity.

Many thanks for your tireless efforts.

Erik


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