unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: guillaume papin <guillaume.papin@epitech.eu>
To: "João Távora" <joaotavora@gmail.com>, "Reuben Thomas" <rrt@sc3d.org>
Cc: Richard Stallman <rms@gnu.org>,
	Noam Postavsky <npostavs@users.sourceforge.net>,
	Sami Kerola <kerolasa@iki.fi>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Alan Mackenzie <acm@muc.de>, Eli Zaretskii <eliz@gnu.org>,
	"sdl.web@gmail.com" <sdl.web@gmail.com>
Subject: Re: [PATCH] Flymake support for C/C++
Date: Sat, 14 Oct 2017 10:56:10 +0000	[thread overview]
Message-ID: <HE1PR02MB11950057A2B9F146A3B32D0D8D490@HE1PR02MB1195.eurprd02.prod.outlook.com> (raw)
In-Reply-To: <874lr2kr9r.fsf@gmail.com>

flycheck used to invoke Make, at least for checking Makefiles.
However they removed this feature[1],
after user complained about the security implication of invoking Make[2] [3].

The issue being that even in --just-print mode, Make can do some work.

On a side note, at some point earlier they changed the --dry-run flag (equivalent to --just-print) by -n,
because the latter is POSIX compliant, working with more make implementations[4].

To answer your questions, which weren't addressed to me but I will share what I know:

> In the context of this specific subthread, can you tell us if Flycheck
> automatically infers the compilation flags of, say, GNU Emacs and GNU
> Hello when checking C code? Does it do so for any other project?

Out-of-the-box, Flycheck does not seem to infer the flags for GNU Hello.
For example I have the following error when I open src/hello.c:

    error           config.h: No such file or directory (c/c++-gcc)

There are options to configure flycheck with the following customization variables:
    flycheck-c/c++-gcc-executable
      User option: The executable of the c/c++-gcc syntax checker.
    flycheck-gcc-args
      User option: A list of additional command line arguments.
    flycheck-gcc-definitions
      User option: Additional preprocessor definitions for GCC.
    flycheck-gcc-include-path
      User option: A list of include directories for GCC.
    flycheck-gcc-includes
      User option: A list of additional include files for GCC.
    flycheck-gcc-language-standard
      User option: The language standard to use in GCC.
    flycheck-gcc-no-exceptions
      User option: Whether to disable exceptions in GCC.
    flycheck-gcc-no-rtti
      User option: Whether to disable RTTI in GCC.
    flycheck-gcc-openmp
      User option: Whether to enable OpenMP in GCC.
    flycheck-gcc-pedantic
      User option: Whether to warn about language extensions in GCC.
    flycheck-gcc-pedantic-errors
      User option: Whether to error on language extensions in GCC.
    flycheck-gcc-warnings
      User option: A list of additional warnings to enable in GCC.

M-x customize-variable RET flycheck-gcc-args RET can be sufficient, the other options preceded this generic option.
However settings the option per file manually does not really scale IMHO.
Also, many other features would benefit from knowing these compile options, for example ff-find-other-file, c-macro-expand, and maybe more in the futur: disassembler plugin, company mode, GCC fix-it hints[6] integration, 

Then there is flycheck extension, like one I maintain (irony-mode) and others,
such as cmake-ide and ede-compdb, that uses the compilation database I mentioned earlier[5].
For example ede-compdb works for both flymake and flycheck:
- https://github.com/randomphrase/ede-compdb#flymake-support

I'm not sure that the best solution is for flymake to invent it's own way of getting the compile options.
IMHO it would be best if it only provided a way to customize them,
letting the burden of how to do it to "something else", but I may not be practical here.

[1] https://github.com/flycheck/flycheck/blob/cfe02c0b2f0ad09ff0555583b5cf43125f549108/CHANGES.old#L129
[2] https://github.com/flycheck/flycheck/issues/572
[3] https://github.com/flycheck/flycheck/issues/573
[4] https://github.com/flycheck/flycheck/issues/322
[5] https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00398.html
[6] GCC -fdiagnostics-parseable-fixits option, from https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html


  reply	other threads:[~2017-10-14 10:56 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 15:09 [PATCH] Flymake support for C/C++ João Távora
2017-10-12 15:50 ` Mark Oteiza
2017-10-12 17:50 ` Alan Mackenzie
2017-10-12 18:45   ` Stefan Monnier
2017-10-12 20:45     ` Alan Mackenzie
2017-10-12 21:03       ` Stefan Monnier
2017-10-13  6:28       ` Eli Zaretskii
2017-10-12 18:46   ` João Távora
2017-10-12 20:39     ` Alan Mackenzie
2017-10-12 21:05       ` Stefan Monnier
2017-10-12 21:24       ` João Távora
2018-06-01 21:07         ` Alan Mackenzie
2018-06-01 21:54           ` João Távora
2018-06-01 22:08             ` Stefan Monnier
2018-06-01 23:23               ` Rolf Ade
2018-06-02 10:33             ` Alan Mackenzie
2018-06-02 14:44               ` Stefan Monnier
2018-06-02 18:13               ` João Távora
2018-06-03 15:45                 ` Alan Mackenzie
2018-06-03 16:28                   ` João Távora
2018-06-03 16:43                     ` Alan Mackenzie
2018-06-03 17:02                       ` João Távora
2018-06-02 17:16           ` Stefan Monnier
2018-06-02 15:26   ` Stefan Monnier
2018-06-03 13:44     ` Alan Mackenzie
2017-10-14  1:34 ` Richard Stallman
2017-10-14  7:10   ` Reuben Thomas
2017-10-14  7:58     ` Sami Kerola
2017-10-14  8:00     ` Eli Zaretskii
2017-10-14  8:15       ` Reuben Thomas
2017-10-14  8:22         ` Dmitry Gutov
2017-10-14  8:29           ` Reuben Thomas
2017-10-14 10:36             ` Eli Zaretskii
2017-10-14 11:22               ` Reuben Thomas
2017-10-14  8:33         ` Eli Zaretskii
2017-10-17 10:53           ` Phillip Lord
2017-10-17 10:56             ` Reuben Thomas
2017-10-18  4:03               ` Richard Stallman
2017-10-18 10:18                 ` Reuben Thomas
2017-10-19  3:26                   ` Richard Stallman
2017-10-19  7:38                     ` Reuben Thomas
2017-10-22 23:18                       ` Richard Stallman
2017-10-22 23:23                         ` Reuben Thomas
2017-10-24  4:12                           ` Richard Stallman
2017-10-24  9:45                             ` Reuben Thomas
2017-10-24  9:48                               ` Dmitry Gutov
2017-10-24  9:52                                 ` Reuben Thomas
2017-10-24  9:57                                   ` Dmitry Gutov
2017-10-24 10:07                                     ` Reuben Thomas
2017-10-24 10:21                                       ` Dmitry Gutov
2017-10-24 10:28                                         ` Reuben Thomas
2017-10-24 15:44                                   ` Stefan Monnier
2017-10-25 19:30                               ` Richard Stallman
2017-10-27  0:43                                 ` Reuben Thomas
2017-10-28 21:47                                   ` Richard Stallman
2017-10-18 12:16           ` Clément Pit-Claudel
2017-10-18 17:30             ` John Wiegley
2017-10-14 13:55         ` Stefan Monnier
2017-10-14  9:33     ` João Távora
2017-10-14 10:56       ` guillaume papin [this message]
2017-10-14 16:29         ` João Távora
2017-10-14 16:36           ` Reuben Thomas
2017-10-18 12:22           ` Clément Pit-Claudel
2017-10-18 14:26             ` João Távora
2017-10-14  9:29   ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=HE1PR02MB11950057A2B9F146A3B32D0D8D490@HE1PR02MB1195.eurprd02.prod.outlook.com \
    --to=guillaume.papin@epitech.eu \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=kerolasa@iki.fi \
    --cc=monnier@iro.umontreal.ca \
    --cc=npostavs@users.sourceforge.net \
    --cc=rms@gnu.org \
    --cc=rrt@sc3d.org \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).