zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: allow multiple completion for gcc -Wsuggest-attribute
@ 2018-11-11  1:44 Oliver Kiddle
  2018-11-12 13:38 ` Mikael Magnusson
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Kiddle @ 2018-11-11  1:44 UTC (permalink / raw)
  To: Zsh workers

gcc allows the -Wsuggest-attribute option to be repeated because it can
be used with each of the four possible values.

Oliver

diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc
index 8687adc6e..1052967c7 100644
--- a/Completion/Unix/Command/_gcc
+++ b/Completion/Unix/Command/_gcc
@@ -628,7 +628,7 @@ args+=(
   '-Wstrict-selector-match[Warn if type signatures of candidate methods do not match exactly]'
   '-Wstringop-overflow[Warn about buffer overflow in string manipulation functions like memcpy and strcpy.  Same as  -Wstringop-overflow=]'
   '-Wsubobject-linkage[Warn if a class type has a base or a field whose type uses the anonymous namespace or depends on a type with no linkage]'
-  '-Wsuggest-attribute=-[Warn about functions which might be candidates for __attribute__((const))]:const:(pure const noreturn format)'
+  '*-Wsuggest-attribute=-[warn about functions which might be candidates for __attribute__((const))]:const:(pure const noreturn format)'
   '-Wsuggest-final-methods[Warn about C++ virtual methods where adding final keyword would improve code quality]'
   '-Wsuggest-final-types[Warn about C++ polymorphic types where adding final keyword would improve code quality]'
   '-Wsuggest-override[Suggest that the override keyword be used when the declaration of a virtual function overrides another]'

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: allow multiple completion for gcc -Wsuggest-attribute
  2018-11-11  1:44 PATCH: allow multiple completion for gcc -Wsuggest-attribute Oliver Kiddle
@ 2018-11-12 13:38 ` Mikael Magnusson
  2018-11-13 11:29   ` Oliver Kiddle
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Magnusson @ 2018-11-12 13:38 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: Zsh workers

On 11/11/18, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> gcc allows the -Wsuggest-attribute option to be repeated because it can
> be used with each of the four possible values.
>
> Oliver
>
> diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc
> index 8687adc6e..1052967c7 100644
> --- a/Completion/Unix/Command/_gcc
> +++ b/Completion/Unix/Command/_gcc
> @@ -628,7 +628,7 @@ args+=(
>    '-Wstrict-selector-match[Warn if type signatures of candidate methods do
> not match exactly]'
>    '-Wstringop-overflow[Warn about buffer overflow in string manipulation
> functions like memcpy and strcpy.  Same as  -Wstringop-overflow=]'
>    '-Wsubobject-linkage[Warn if a class type has a base or a field whose
> type uses the anonymous namespace or depends on a type with no linkage]'
> -  '-Wsuggest-attribute=-[Warn about functions which might be candidates for
> __attribute__((const))]:const:(pure const noreturn format)'
> +  '*-Wsuggest-attribute=-[warn about functions which might be candidates
> for __attribute__((const))]:const:(pure const noreturn format)'
>    '-Wsuggest-final-methods[Warn about C++ virtual methods where adding
> final keyword would improve code quality]'
>    '-Wsuggest-final-types[Warn about C++ polymorphic types where adding
> final keyword would improve code quality]'
>    '-Wsuggest-override[Suggest that the override keyword be used when the
> declaration of a virtual function overrides another]'

Is there a specific reason you changed "Warn" to be lower case
inconsistent with all the other descriptions here?

-- 
Mikael Magnusson

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: allow multiple completion for gcc -Wsuggest-attribute
  2018-11-12 13:38 ` Mikael Magnusson
@ 2018-11-13 11:29   ` Oliver Kiddle
  0 siblings, 0 replies; 3+ messages in thread
From: Oliver Kiddle @ 2018-11-13 11:29 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: Zsh workers

Mikael Magnusson wrote:
> Is there a specific reason you changed "Warn" to be lower case
> inconsistent with all the other descriptions here?

Lower case is the normal convention for completion functions and I
apply corrections for common things like that on lines that I'm
otherwise modifying. I can see that in this particular case, it is
rather less than ideal because there's a lot of similar options.

The trouble with big patches to correct things like case and indentation
is that they obscure history in git.

In the case of gcc, I'd be inclined to treat warnings as a single -W
option that takes an argument:
  '*-W-[enable/disable a warning]:warning:->warnings'
Then parse the output of gcc --help=warnings and strip off the then
superfluous "Warn (about|when|if) " part of the descriptions.

Oliver

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-13 11:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-11  1:44 PATCH: allow multiple completion for gcc -Wsuggest-attribute Oliver Kiddle
2018-11-12 13:38 ` Mikael Magnusson
2018-11-13 11:29   ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).