This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: RFA: Use .opt files for the m68k port


On Sat, Apr 16, 2005 at 09:52:52AM +0100, Richard Sandiford wrote:
> Gunther Nikl <gni@gecko.de> writes:
> >   BTW, there seems to be a bug in handle_option/OPT_mshared_library_id_:
> >   the error message passes arg but should pass value.
> 
> You mean this:
> 
> 	error ("-mshared-library-id=%s is not between 0 and %d",
> 	       arg, MAX_LIBRARY_ID);
> 
> ?  No, it's correct.  (I did test it before posting, honest. ;)

  Yes, thats place I was talking about. Now I noticed that I missed the
  "%s" format string :-/ Since "value" is used in the compare I assumed
  that value should also be used in the message.

> ARG is the string value of the argument and VALUE is the integer
> value.  Specifically, ARG is always the string argument of a
> Joined option and VALUE is always the integer value of a
> UInteger option.
> 
> Stylistically, it's probably better to use ARG instead of VALUE
> in error messages so that the message will say exactly what the
> user typed.  (I seem to remember I used VALUE upthread, sorry.)
> It doesn't matter much either way though.

  Your explanation makes perfectly sense. I have changed the error
  message in my patch to use arg.

> >   And I have further question: Is it possible to have an option
> >   (switch?) that clears several other flags at once?
> 
> Yes.  See m68k_handle_option.  Options like -m68000 are already
> doing this.

  Whoops. I should have noticed that myself.

> >   And how is a subtarget supposed to handle own options? With
> >   something like a SUBTARGET_OPTIONS call in the target option
> >   handler?
> 
> There's no prescribed way.  Whatever the target maintainers think
> is best, basically.  Using something like SUBTARGET_OPTIONS would
> certainly be one way.  Another would be to add the code to the main
> handle_option function and guard it with ifdefs.

  I decided to use #ifdef. Thanks for your help.

  FWIW, I built a compiler without the option patch and one with
  the patch. Then I used both to compile a random application. All
  object files were identical. I thought about building a native
  GCC for my target but I didn't have the time for that task.

  Gunther


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