SublimeLinter / SublimeLinter-gcc

This linter plugin for SublimeLinter provides an interface to gcc or other gcc-like (cross-)compiler.
MIT License
22 stars 5 forks source link

Remove -fsyntax-only in common_flags or make it an option #4

Closed mandeep closed 6 years ago

mandeep commented 6 years ago

The -fsyntax-only flag is nice, however it doesn't allow some checks to be run. Especially if an optimization level like -O3 is given. One example is -Wreturn-type: this error won't be shown by the linter when the -fsyntax-only flag is given. One remedy would be to remove the -fsyntax-only flag completely. Another option would be to move the flag to extra_flags so that the user can easily remove it if needed.

https://github.com/jfcherng/SublimeLinter-contrib-gcc/blob/master/linter.py#L72

jfcherng commented 6 years ago

Did you code in C?

I found persist.get_syntax(self.view) always return 'c++' somehow. No matter open a .c file or use C syntax.


Update: Sorry my bad. It's my old mapping.

jfcherng commented 6 years ago

Ok. I could reproduce it with flags -std=c90

main () {
    return 0;
}
jfcherng commented 6 years ago

Done in 1.2.2.

mandeep commented 6 years ago

Thanks!