about summary refs log tree commit diff
diff options
context:
space:
mode:
authorShohei YOSHIDA <syohex@gmail.com>2023-01-24 11:08:32 +0900
committerDaniel Shahaf <d.s@daniel.shahaf.name>2023-01-24 09:00:07 +0000
commitba834fa53c4f6919eebd4b5feee69f720ffe3e7e (patch)
tree93712cc88f29f11be4e07ee30b985ba44a1ef2f1
parentf54ed0b76a07f21c96ddf5b51dc46d9e8b74e41c (diff)
downloadzsh-ba834fa53c4f6919eebd4b5feee69f720ffe3e7e.tar.gz
zsh-ba834fa53c4f6919eebd4b5feee69f720ffe3e7e.tar.xz
zsh-ba834fa53c4f6919eebd4b5feee69f720ffe3e7e.zip
51326: Improve -fsanitize option completion
- Support comma separated completion
- Accept multiple `-fsanitize` options
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_gcc5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8e71f1ced..2bbddeccc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-01-24  Shohei YOSHIDA  <syohex@gmail.com>
+
+	* 51326: Completion/Unix/Command/_gcc: Improve -fsanitize
+	option completion
+
 2023-01-22  Shohei YOSHIDA  <syohex@gmail.com>
 
 	* 51322 (+ minor tweak): Completion/Unix/Command/_make: Update gnu
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