[Bug driver/43687] Unexpected error message for bad command line argument
manu at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Apr 15 22:22:00 GMT 2010
------- Comment #13 from manu at gcc dot gnu dot org 2010-04-15 22:21 -------
(In reply to comment #12)
>
> I don't see adding function pointers as a particular improvement over the
> existing code where switch statements can already handle group options
That code does not work when options are disabled/enabled from anywhere else
apart from the command line. See PR40989.
With function pointers we can do:
+ if (option->var_type == CLVC_BOOLEAN)
+ {
+ if (option->set)
+ option->set (1);
+ if (option->flag_var)
+ *(int *) option->flag_var = 1;
+ }
> including setting option variables only if they are still -1 (as done for
> various options at present); marking group options only seems useful to me
> if the .opt file also lists implications so that the ordering rules are
> handled automatically.
This could be implemented later by extending Group to Group(option1,option2).
Then the awk scripts would generate the set_ function. But the function
pointers seem as a first step to me.
But if you think it is a bad idea, I will stop now rather than go on and waste
my time.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43687
More information about the Gcc-bugs
mailing list