ProductPromotion
Logo

C Programming

made by https://0x3d.site

GitHub - AtomLinter/linter-gcc: Atom-linter extension to lint C/C++ source files using gcc/g++
Atom-linter extension to lint C/C++ source files using gcc/g++ - AtomLinter/linter-gcc
Visit Site

GitHub - AtomLinter/linter-gcc: Atom-linter extension to lint C/C++ source files using gcc/g++

GitHub - AtomLinter/linter-gcc: Atom-linter extension to lint C/C++ source files using gcc/g++

linter-gcc

Join the chat at https://gitter.im/linter-gcc/Lobby Build Status apm

This plugin provides an interface to gcc/g++ for linting and works with Linter.

Used with files with grammar "C", "C++" and "C++14".

Includes linting on-the-fly, though it is only partially tested. Please open an issue if you encounter any problems.

Important info for Mac OSX users!

If you have XCode installed on OSX, the gcc/g++ commands will both link to clang. This can cause issues with the -fmax-errors option used by linter-gcc, which isn't recognised by clang. To properly install GCC, you need to install it with Homebrew (instructions here). You will likely also need to add the flag -fsyntax-only to your C Flags or C++ Flags.

Linter in action!

linter-gcc screenshot

Using CMake compile settings

linter-gcc can take compile settings from CMake. For example:

git clone https://github.com/hebaishi/gtf2tab
cd gtf2tab
mkdir build
cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..

Running cmake with the -DCMAKE_EXPORT_COMPILE_COMMANDS flag generates a compile_commands.json file which linter-gcc can get the compile settings from. Then you simply open the project in Atom, and enter ./build/compile_commands.json in the Compile Commands File setting of linter-gcc. Note that if you supply a valid compile_commands.json file, your include paths and compile flags configuration settings (described below) are ignored.

Unfortunately, CMake does not typically compile header files so the compile_commands.json file does not include entries for these files. To add them you can use a tool like compdb.

compdb -p ./ list > compile_commands.json

File/Project-Specific settings

Assuming you have the a file called sample.cpp open, linter-gcc performs the following actions:

  1. Looks for file called sample.cpp.gcc-flags.json in the same directory as your source file (file-specific settings)
  2. Looks for a file called .gcc-flags.json in every subdirectory from the current up to your project root (subdirectory/project-specific settings)
  3. If no .gcc-flags.json is found, the settings in your configuration page are used.

The package takes its settings from the first configuration file that is found.

You can specify your settings in .gcc-flags.json, at any level (file/subdirectory/project) using the following syntax:

{
  "execPath": "/usr/bin/g++",
  "gccDefaultCFlags": "-Wall",
  "gccDefaultCppFlags": "-Wall -std=c++11",
  "gccErrorLimit": 15,
  "gccIncludePaths": ".,./include,./path",
  "gccSuppressWarnings": true
}

Note that the include paths need to be separated by commas. If this file is present, it will replace the settings you specified in the settings window. Relative paths (starting with . or ..) are expanded with respect to the root folder. Both execPath and gccIncludePaths are expanded.

Paths are expanded relative to the project that contains the file being linted. The package limits its search to 30 levels when looking for a configuration file. Within each project, you may have as many file/directory-specific configuration files as you wish.

Usage notes:

  • Add -fsyntax-only to your C/C++ compilation flags to prevent the generation of .gch files when linting headers
  • Add -c to your flags to avoid linking errors.

Plugin installation

Press ctrl and ',' or cmd and ',' , click on 'Packages', search 'linter gcc', or:

$ apm install linter-gcc

Reporting Issues

Please read the Wiki before reporting any issues.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory