Actualmente GCC no tiene forma de suprimir esta advertencia. Y flycheck no tiene forma de ignorar los errores sin tocar sus partes internas.
Aquí hay un truco que funciona para gcc:
; ignore gcc "#pragma once" warning
(with-eval-after-load "flycheck"
(eval-when-compile (require 'flycheck)) ; for flycheck-error struct
(defun my-filter-pragma-once-in-main (orig-fun errors)
(dolist (err errors)
(-when-let (msg (flycheck-error-message err))
(setf (flycheck-error-message err)
(if (string-match-p "#pragma once in main file" msg) nil msg))))
(funcall orig-fun errors))
(advice-add 'flycheck-sanitize-errors :around #'my-filter-pragma-once-in-main))
Para completar, la respuesta de @ grepcake para clang:
; ignore clang "#pragma once" warning
(with-eval-after-load "flycheck"
(setq flycheck-clang-warnings `(,@flycheck-clang-warnings
"no-pragma-once-outside-header")))