summaryrefslogtreecommitdiff
path: root/ale_linters/cpp/gcc.vim
AgeCommit message (Collapse)Author
2020-08-20#3299 Merge gcc and clang into a cc linterw0rp
Users can easily be confused when they set some options for a C or C++ compiler, and another compiler is run with different options, which still reports errors. To remedy this, the existing `gcc` and `clang` linters have been replaced with a `cc` linter that will run either compiler. This is a breaking change for ALE v3.0.0.
2020-03-17Avoid overriding parsed C/C++ -std=* flagAlex Wang
ALE appends flags from {c,cpp}_{clang,gcc}_options after those found by parsing compile_commands.json or Makefile output. If -std=* flags are present in both the ALE flags and parsed flags, the last one present (i.e., ALE's -std=* flag) will determine the mode the compiler works in. This can result in errors showing up in vim but not in the actual build or vice-versa. For example, say you have foo.cpp: #include <type_traits> int main() { return std::is_same_v<float, int>; } If cpp_clang_options contains -std=c++17 and -std=c++14 is parsed from compile_commands.json, then ALE would end up running something like: clang++ -S -x c++ -fsyntax-only -std=c++14 -std=c++17 - < foo.cpp This would result in no errors showing up in Vim, but the actual build would fail with: <stdin>:3:14: error: no template named 'is_same_v' in namespace 'std'; did you mean 'is_same'? return std::is_same_v<float, int>; ~~~~~^~~~~~~~~ is_same /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/type_traits:872:61: note: 'is_same' declared here template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {}; ^ <stdin>:3:35: error: expected '(' for function-style cast or type construction return std::is_same_v<float, int>; ~~~~~~~~~~~~~~~~~~~~~~~~~~^ 2 errors generated. as the actual build would not have the -std=c++17 flag added by ALE. If cpp_clang_options contains -std=c++14 and -std=c++17 is parsed from compile_commands.json, then the opposite problem would occur. ALE would end up running something like: clang++ -S -x c++ -fsyntax-only -std=c++17 -std=c++14 - < foo.cpp and would show an error on line 3 of foo.cpp: [clang] No template named 'is_same_v' in namespace 'std'; did you mean 'is_same'? (fix available) The actual build, on the other hand, would succeed without any complaints. Removing -std=* from ALE's flags if it is already present in the parsed flags ensures that the wrong -std=* flag is not used. An alternative would have been to switch the order in which parsed flags and ALE flags were concatenated when producing the command to execute, but that could prevent a user from intentionally using ALE's flags to override some other flags, e.g. -W* flags to enable/disable warnings in a project whose flags are not under the developer's control. -std=* flags are also present in cuda/nvcc.vim, objc/clang.vim, objcpp/clang.vim, and vhdl/ghdl.vim, but none of those linters appear to parse compile_commands.json or `make` output.
2019-05-20Fix #2512 - Use -o /dev/null for gcc lintingw0rp
2019-04-07#2132 - Replace command_chain and chain_with with ale#command#Runw0rp
2019-02-22#2132 - Replace all uses of foo_callback with foow0rp
2018-08-02Simplify the code for most linters and tests with closuresw0rp
2018-07-30Indicate that a C compiler failed due to problems in a header filew0rp
2018-07-29Add support for parsing compile_commands.json files for C compilersw0rp
2018-04-10Fix #1490 - Rename the g++ linter to gcc, and add an alias for the old namew0rp
2018-03-27#1167 Use the make -n parsing for C++ compilers, and document the new optionw0rp
2017-07-16#711 - Make the gcc executables configurablew0rp
2017-06-25Move ale#handlers#c functions into ale#cw0rp
2017-05-31Fix #557 - Detect C project roots and include root directories with headers, ↵w0rp
or include directories
2017-05-12#549 Temporarily revert shell escaping changes, just for Windowsw0rp
2017-05-08#540 Fix shell escaping pretty much everywherew0rp
2017-04-29Set GCC flags appropriately for older versionsw0rp
2017-04-16#427 Implement buffer variable overrides for all linter optionsw0rp
2017-04-15Make code more consistentw0rp
2017-04-11#392 Report errors inside of headers, in a very basic wayw0rp
2017-03-11#277 #318 Support all same-directory includes for gcc and clangw0rp
2016-12-24Added ability to reload compilation flags for c and c++ after loading plugingrzebiel
2016-10-21Add support for dot-seperate linters, improve linter testsBjorn Neergaard
This PR first and formost implements support for dot-seperate filetypes, a very trivial change. This closes #132 But more importantly, this PR vastly improves the test quality for `ale#linter#Get`. It enables us to reset the state of ale's internal linter cache, to facilitate better testing, as well as making use of mocked linters instead of depending on linters on disk (which may change). In addition, a dummy linter is defined to test the autoloading behavior. Header guards were removed from all linters as: * A: ale won't try and load linters if they already exist in memory * B: we can't reset state for testing if they can't be loaded again
2016-10-21make it less verbose for c and cppehzShelter
2016-10-21Added c++14 standard support and POSIX API compile time linker flags for ↵ehzShelter
avoiding annoying errors and warnings
2016-10-10First pass at optimizing ale to autoload (#80)Bjorn Neergaard
* First pass at optimizing ale to autoload First off, the structure/function names should be revised a bit, but I will wait for @w0rp's input before unifying the naming style. Second off, the docs probably need some more work, I just did some simple find-and-replace work. With that said, this pull brings major performance gains for ale. On my slowest system, fully loading ale and all its code takes around 150ms. I have moved all of ale's autoload-able code to autoload/, and in addition, implemented lazy-loading of linters. This brings load time on that same system down to 5ms. The only downside of lazy loading is that `g:ale_linters` cannot be changed at runtime; however, it also speeds up performance at runtime by simplfying the logic greatly. Please let me know what you think! Closes #59 * Address Travis/Vint errors For some reason, ale isn't running vint for me... * Incorporate feedback, make fixes Lazy-loading logic is much improved. * Add header comments; remove incorrect workaround * Remove unneeded plugin guards * Fix lazy-loading linter logic Set the wrong variable.... * Fix capitialization
2016-10-08Add cpp linter (#64)Marc Delage
* Add c gcc option in the doc * Add missing tag for eslint option in the doc * Correct typo in doc (' ' instead of '.') * add cpp linter * correct typo in doc * add filetype information for c++