[PATCH] Re: gas: should duplicate .macro directives be allowed?

Jan Beulich JBeulich@novell.com
Tue Mar 8 09:43:00 GMT 2005


>>> Daniel Jacobowitz <drow@false.org> 07.03.05 17:19:17 >>>
>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.

gas/
2004-03-08  Jan Beulich  <jbeulich@novell.com>

	* doc/as.texinfo: Add sentence to indicate redefining a macro is
an
	error, and point to .purgem documentation if someone really
needs
	re-definitions.
	* NEWS: Mention macro redefinition is now an error.

---
/home/jbeulich/src/binutils/mainline/2005-03-08/gas/NEWS	2005-02-28
08:27:12.000000000 +0100
+++ 2005-03-08/gas/NEWS	2005-03-08 10:14:27.334292936 +0100
@@ -1,5 +1,7 @@
 -*- text -*-
 
+* Redefinition of macros now results in an error.
+
 * New command line option -mhint.b=[ok|warning|error] for IA64
targets.
 
 * New command line option -munwind-check=[warning|error] for IA64
---
/home/jbeulich/src/binutils/mainline/2005-03-08/gas/doc/as.texinfo	2005-03-04
15:51:47.000000000 +0100
+++ 2005-03-08/gas/doc/as.texinfo	2005-03-08 10:35:54.158665896
+0100
@@ -4838,8 +4838,10 @@ With that definition, @samp{SUM 0,5} is 
 Begin the definition of a macro called @var{macname}.  If your macro
 definition requires arguments, specify their names after the macro
name,
 separated by commas or spaces.  You can supply a default value for
any
-macro argument by following the name with @samp{=@var{deflt}}.  For
-example, these are all valid @code{.macro} statements:
+macro argument by following the name with @samp{=@var{deflt}}.  You
+cannot define two macros with the same @var{macname} unless it has
been
+subject to the @code{.purgem} directive (@xref{Purgem}.) between the
two
+definitions.  For example, these are all valid @code{.macro}
statements:
 
 @table @code
 @item .macro comm

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: binutils-mainline-macro-diagnostics-doc.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20050308/dd7c199a/attachment.ksh>


More information about the Binutils mailing list