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: tests for --help


On Fri, Apr 10, 2009 at 12:28 AM, Ralf Wildenhues
<Ralf.Wildenhues@gmx.de> wrote:
> * Joseph S. Myers wrote on Fri, Apr 10, 2009 at 09:02:42AM CEST:
>> On Fri, 10 Apr 2009, Ralf Wildenhues wrote:
>>
>> > -check_for_options c "--help=undocumented" "This switch lacks documentation" "" ""
>> > +# Do not check for "This switch lacks documentation" here, because
>> > +# ENABLE_CHECKING may turn that off.
>> > +check_for_options c "--help=undocumented" "" "" ""
>>
>> I think the actual bug is that this observable behavior depends on
>> --enable-checking; the "This switch lacks documentation" should be used
>> unconditionally, rather than depending on how the compiler was configured.
>
> That was added as part of
>
> 2008-02-19 ?Nick Clifton ?<nickc@redhat.com>
>
> ? ? ? ?PR other/31349
> ? ? ? ?* opts.c (undocumented_msg): Leave blank unless checking is
> ? ? ? ?enabled.
> ? ? ? ?[...]
>
> and the discussion in <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31349>
> leaves me wondering whether the result was a good consensus.
>
> I personally find "This switch lacks documentation" ugly, too, but I
> assume GCC developers don't read --help output anyway, and it has the
> advantages that users might be more likely to report a bug, and not
> assume that a switch without documentation in --help is a no-op.
>
> Here's the alternative patch I'm testing right now.
>
> Cheers,
> Ralf
>
> gcc/ChangeLog:
> 2009-04-10 ?Ralf Wildenhues ?<Ralf.Wildenhues@gmx.de>
>
> ? ? ? ?PR testsuite/39710
> ? ? ? ?* opts.c (undocumented_msg): Do not leave blank even with

                                         ^^^^ without?
> ? ? ? ?ENABLE_CHECKING.
>
> Index: gcc/opts.c
> ===================================================================
> --- gcc/opts.c ?(Revision 145850)
> +++ gcc/opts.c ?(Arbeitskopie)
> @@ -338,11 +338,7 @@
> ?struct visibility_flags visibility_options;
>
> ?/* What to print when a switch has no documentation. ?*/
> -#ifdef ENABLE_CHECKING
> ?static const char undocumented_msg[] = N_("This switch lacks documentation");
> -#else
> -static const char undocumented_msg[] = "";
> -#endif
>
> ?/* Used for bookkeeping on whether user set these flags so
> ? ?-fprofile-use/-fprofile-generate does not use them. ?*/
>



-- 
H.J.


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