This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: [PATCH] add directive to enter/leave alternate macro mode


This doesn't seem to work for me. Since getopt_long_only accepts option
abbreviations as well as long options with only a single dash, -al gets
treated as -alternate now, breaking previous behavior. (Also, the code
you added to the 'a' case doesn't seem to ever get executed.) Jan

>>> Nick Clifton <nickc@redhat.com> 03.08.04 10:26:00 >>>
Hi Jan,

> I made the option all lower case first, but that collides with the
> listing options (-a...) due to gas allowing long options to be
preceeded
> by either a double or a single dash. Prior to posting an update, I'd
be
> glad to get some advice as to how to proceed here... Thanks, Jan

Just parse it as part of the -a switch, like this:

Cheers
   Nick
------------------------------------------------------------------------

Index: gas/as.c
===================================================================
RCS file: /cvs/src/src/gas/as.c,v
retrieving revision 1.51
diff -c -3 -p -r1.51 as.c
*** gas/as.c	27 Oct 2003 12:45:17 -0000	1.51
--- gas/as.c	3 Aug 2004 08:24:05 -0000
*************** parse_args (int * pargc, char *** pargv)
*** 414,419 ****
--- 414,420 ----
         OPTION_TARGET_HELP,
         OPTION_EXECSTACK,
         OPTION_NOEXECSTACK,
+       OPTION_ALTERNATE,
         OPTION_WARN_FATAL
       };

*************** parse_args (int * pargc, char *** pargv)
*** 457,462 ****
--- 458,464 ----
       {"execstack", no_argument, NULL, OPTION_EXECSTACK},
       {"noexecstack", no_argument, NULL, OPTION_NOEXECSTACK},
   #endif
+     {"alternate", no_argument, NULL, OPTION_ALTERNATE},
       {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}
       /* When you add options here, check that they do not collide
with
          OPTION_MD_BASE.  See as.h.  */
*************** the GNU General Public License.  This pr
*** 731,742 ****
--- 733,754 ----
   	  flag_always_generate_output = 1;
   	  break;

+ 	case OPTION_ALTERNATE:
+ 	  printf ("--Alternate\n");
+ 	  break;
+
   	case 'a':
   	  if (optarg)
   	    {
   	      if (md_parse_option (optc, optarg) != 0)
   		break;

+ 	      if (strcmp (optarg, "lternate") == 0)
+ 		{
+ 		  optc = OPTION_ALTERNATE;
+ 		  continue;
+ 		}
+
   	      while (*optarg)
   		{
   		  switch (*optarg)


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