Skip to content

Commit

Permalink
Capture GCC warning group as flycheck error id
Browse files Browse the repository at this point in the history
  • Loading branch information
fmdkdd committed May 6, 2017
1 parent f5be6f9 commit 8dce838
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions flycheck.el
Original file line number Diff line number Diff line change
Expand Up @@ -6378,8 +6378,6 @@ warnings."
Requires GCC 4.8 or newer. See URL `https://gcc.gnu.org/'."
:command ("gcc"
"-fshow-column"
"-fno-diagnostics-show-option" ; Do not show the corresponding
; warning group
"-iquote" (eval (flycheck-c/c++-quoted-include-directory))
(option "-std=" flycheck-gcc-language-standard concat)
(option-flag "-pedantic" flycheck-gcc-pedantic)
Expand Down Expand Up @@ -6410,7 +6408,8 @@ Requires GCC 4.8 or newer. See URL `https://gcc.gnu.org/'."
(info line-start (or "<stdin>" (file-name)) ":" line ":" column
": note: " (message) line-end)
(warning line-start (or "<stdin>" (file-name)) ":" line ":" column
": warning: " (message) line-end)
": warning: " (message (one-or-more (not (any "\n["))))
(optional "[" (id (one-or-more not-newline)) "]") line-end)
(error line-start (or "<stdin>" (file-name)) ":" line ":" column
": " (or "fatal error" "error") ": " (message) line-end))
:error-filter
Expand Down
7 changes: 4 additions & 3 deletions test/flycheck-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -2771,10 +2771,11 @@ evaluating BODY."
(let ((flycheck-disabled-checkers '(c/c++-clang c/c++-cppcheck)))
(flycheck-ert-should-syntax-check
"language/c_c++/warning.c" 'c-mode
'(5 10 warning "unused variable 'unused'" :checker c/c++-gcc)
'(5 10 warning "unused variable 'unused'"
:id "-Wunused-variable" :checker c/c++-gcc)
'(7 15 warning "comparison between signed and unsigned integer expressions"
:checker c/c++-gcc)
'(8 7 warning "#warning" :checker c/c++-gcc))))
:id "-Wsign-compare" :checker c/c++-gcc)
'(8 7 warning "#warning" :id "-Wcpp" :checker c/c++-gcc))))

(flycheck-ert-def-checker-test c/c++-gcc (c c++) included-file-error
(let ((flycheck-gcc-include-path '("./include"))
Expand Down

0 comments on commit 8dce838

Please sign in to comment.