zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH 0/1] Improve gcc's -fsanitize completion
@ 2023-01-24  2:08 Shohei YOSHIDA
  2023-01-24  2:08 ` [PATCH 1/1] Improve -fsanitize option completion Shohei YOSHIDA
  0 siblings, 1 reply; 3+ messages in thread
From: Shohei YOSHIDA @ 2023-01-24  2:08 UTC (permalink / raw)
  To: zsh-workers; +Cc: Shohei YOSHIDA

GCC accepts multiple `-fsanitize` options and it supports
comma separated arguments.

For example

gcc -fsanitize=address -fsanitize=alignment,undefined foo.c

Shohei YOSHIDA (1):
  Improve -fsanitize option completion

 Completion/Unix/Command/_gcc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.37.2



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

* [PATCH 1/1] Improve -fsanitize option completion
  2023-01-24  2:08 [PATCH 0/1] Improve gcc's -fsanitize completion Shohei YOSHIDA
@ 2023-01-24  2:08 ` Shohei YOSHIDA
  2023-01-24  9:06   ` Daniel Shahaf
  0 siblings, 1 reply; 3+ messages in thread
From: Shohei YOSHIDA @ 2023-01-24  2:08 UTC (permalink / raw)
  To: zsh-workers; +Cc: Shohei YOSHIDA

- Support comma separated completion
- Accept multiple `-fsanitize` options
---
 Completion/Unix/Command/_gcc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc
index f10000391..8690c5599 100644
--- a/Completion/Unix/Command/_gcc
+++ b/Completion/Unix/Command/_gcc
@@ -1894,7 +1894,7 @@ args+=(
   '-freschedule-modulo-scheduled-loops[enable/disable the traditional scheduling in loops that already passed modulo scheduling]'
   '-frounding-math[disable optimizations that assume default FP rounding behavior]'
   '-frtti[generate run time type descriptor information]'
-  "-fsanitize=-[enable AddressSanitizer, a memory error detector]:style:($sanitizers)"
+  "*-fsanitize=-[enable AddressSanitizer, a memory error detector]:style:->sanitize"
   '-fsched2-use-superblocks[if scheduling post reload, do superblock scheduling]'
   '-fsched-critical-path-heuristic[enable the critical path heuristic in the scheduler]'
   '-fsched-dep-count-heuristic[enable the dependent count heuristic in the scheduler]'
@@ -2284,6 +2284,9 @@ archgeneric)
   arch+=(generic)
   _wanted cputypes expl "CPU type" compadd -a arch && ret=0
   ;;
+sanitize)
+  _values -s , 'sanitizer' $sanitizers
+  ;;
 esac
 
 return ret
-- 
2.37.2



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

* Re: [PATCH 1/1] Improve -fsanitize option completion
  2023-01-24  2:08 ` [PATCH 1/1] Improve -fsanitize option completion Shohei YOSHIDA
@ 2023-01-24  9:06   ` Daniel Shahaf
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Shahaf @ 2023-01-24  9:06 UTC (permalink / raw)
  To: Shohei Yoshida, zsh-workers

Thanks, applied.

While testing this I noticed that the candidate completions were in
bold.  That was in a minimal environment that had only the following
styles set:

zstyle ':completion:*' format '>>> %B%d%b'
zstyle ':completion:*' group-name ''

Removing the first style made candidate completions print in non-bold.

I see 51320 hasn't been pushed yet but I'm not sure whether it's related.

I haven't time to investigate this any further.


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

end of thread, other threads:[~2023-01-24  9:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-24  2:08 [PATCH 0/1] Improve gcc's -fsanitize completion Shohei YOSHIDA
2023-01-24  2:08 ` [PATCH 1/1] Improve -fsanitize option completion Shohei YOSHIDA
2023-01-24  9:06   ` Daniel Shahaf

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).