unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70716: flymake-cc creates `-.o` files
@ 2024-05-02 13:10 Mattias Engdegård
  2024-05-02 13:13 ` João Távora
  0 siblings, 1 reply; 6+ messages in thread
From: Mattias Engdegård @ 2024-05-02 13:10 UTC (permalink / raw)
  To: 70716; +Cc: João Távora

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]

`flymake-cc-use-special-make-target`, the standard value for `flymake-cc-command`, generates a command like

  make check-syntax CHK_SOURCES="-x c -c -"

which causes the compiler (at least Clang) to create the file `-.o` that is never cleaned up and whose name is mysterious and awkward to remove.

What about the patch below?


[-- Attachment #2: flymake-cc-null-output.diff --]
[-- Type: application/octet-stream, Size: 637 bytes --]

diff --git a/lisp/progmodes/flymake-cc.el b/lisp/progmodes/flymake-cc.el
index 60e7da5d617..01f463454e9 100644
--- a/lisp/progmodes/flymake-cc.el
+++ b/lisp/progmodes/flymake-cc.el
@@ -95,9 +95,10 @@ flymake-cc-use-special-make-target
   (unless (executable-find "make") (error "Make not found"))
   `("make"
     "check-syntax"
-    ,(format "CHK_SOURCES=-x %s -c -"
+    ,(format "CHK_SOURCES=-x %s -c - -o %s"
              (cond ((derived-mode-p 'c++-mode) "c++")
-                   (t "c")))))
+                   (t "c"))
+             null-device)))
 
 (defvar-local flymake-cc--proc nil "Internal variable for `flymake-cc'.")
 

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

end of thread, other threads:[~2024-05-18  8:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-02 13:10 bug#70716: flymake-cc creates `-.o` files Mattias Engdegård
2024-05-02 13:13 ` João Távora
2024-05-02 14:00   ` Mattias Engdegård
2024-05-04 11:38     ` Eli Zaretskii
2024-05-18  8:33       ` Eli Zaretskii
2024-05-18  8:28   ` Eli Zaretskii

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

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).