GNU bug report logs - #70716
flymake-cc creates `-.o` files

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Date: Thu, 2 May 2024 13:11:01 UTC

Severity: normal

Done: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: sbaugh <at> catern.com
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mattias.engdegard <at> gmail.com, João Távora <joaotavora <at> gmail.com>, 70716 <at> debbugs.gnu.org
Subject: bug#70716: flymake-cc creates `-.o` files
Date: Wed, 28 Aug 2024 17:01:18 +0000 (UTC)
Mattias Engdegård <mattias.engdegard <at> gmail.com> writes:
> `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?

(info "(flymake) Example---Configuring a tool called via make")

mentions a check-syntax target looking like:

check-syntax:
	gcc -o /dev/null -S ${CHK_SOURCES} || true

So it seems like it would be better to add this -o /dev/null in your
Makefile.

That also allows you to run, e.g.,

  make check-syntax CHK_SOURCES="file1.c file2.c"

from a shell or M-x compile.

So I think this is a bug in your Makefile, not flymake-cc.

But, also, probably the docstring of flymake-cc-use-special-make-target
should be updated to link to the manual.  And probably the manual should
mention that CHK_SOURCES can be an explicit list of files too.

BTW, the CHK_SOURCES target mentioned by flymake is, AFAICT from web
searches, completely unique to flymake.  I wonder if there's a more
standard alternative... but we probably can't change the default of
flymake-cc-command anyway.




This bug report was last modified 265 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.