How to create both -option-name-* and -option-name=* options?

Brooks Moses brooks.moses@codesourcery.com
Fri Nov 10 07:37:00 GMT 2006


The Fortran front end currently has a lang.opt entry of the following form:

   ffixed-line-length-
   Fortran RejectNegative Joined UInteger

I would like to add to this the following option which differs in the 
last character, but should be treated identically:

   ffixed-line-length=
   Fortran RejectNegative Joined UInteger

(Why do I want to do this horrible thing?  Well, the second is really 
the syntax we should be using, but I would like to just undocument the 
first version rather than removing it, so as not to break backwards 
compatibility with everyone's makefiles.)

Anyhow, if I try this, I get the following error (trimmed slightly for 
clarity):

   gcc -c [...] ../../svn-source/gcc/genconstants.c
   In file included from tm.h:7,
                    from ../../svn-source/gcc/genconstants.c:32:
   options.h:659: error: redefinition of `OPT_ffixed_line_length_'
   options.h:657: error: `OPT_ffixed_line_length_' previously defined
     here

This is because both the '=' and the '-' in the option name reduce to a 
'_' in the enumeration name, which of course causes the enumerator to 
get defined twice -- and that's a problem, even though I'm quite happy 
for the options to both be treated identically.

There's not really any good way around this problem, is there?

- Brooks



More information about the Gcc mailing list