atomlinter / linter-gcc Goto Github PK
View Code? Open in Web Editor NEWAtom-linter extension to lint C/C++ source files using gcc/g++
License: Other
Atom-linter extension to lint C/C++ source files using gcc/g++
License: Other
linter-clang now supports .clang_complete files which allows you to inject e.g. -I/path/to/include/dir for each project. As each of my projects at work comes bundled with both include dirs and gcc environment I would love something like this.
I.e. support for project specific settings like exec path and include dirs.
Latest release (37dadcf) broke my relative build path I'm afraid.
.gcc-flags.json
{
"execPath": "./Sw/P_XMC/tools/ARM-GCC/bin/arm-none-eabi-gcc",
"gccDefaultCFlags": "-Wall",
"gccDefaultCppFlags": "-Wall -std=c++11",
"gccErrorLimit": 5,
"gccIncludePaths": "Sw/A_XMC/out/obj",
"gccSuppressWarnings": true
}
linter-gcc: "./Sw/P_XMC/tools/ARM-GCC/bin/arm-none-eabi-gcc" not found
Win7, Atom 1.3.2, linter-gcc 0.5.11
Would it be possible to lint fortran code using gfortran with this package? Would it make sense to incorporate fortran linting here, or to fork this package to create a fortran linter ?
A linting on fly (while typing instead after saving a file) is really missing.
I have got an older version of GCC (gcc version 4.1.2 (Altera 11.1 Build 173)), which does not recognize the -fmax-errors=0 option, which gets added by linter-gcc:
cc1.exe: error: unrecognized commandline option "-fmax-errors=0"
Would it be possible to add an option to disable this, so that linter-gcc does not add this flag?
I get the error message "Cannot read property 'binary' of undefined" using latest version of Linter, Atom and Windows 10.
GCC 4.9.3 is installed, and it's working when I compile from command line.
Trying to make it work with C++11.
My GCC path is "C:\MinGW\bin". Also tried that in the Linter GCC settings but to no success.
Hello, I have installed linter, linter-gcc but it's not work for .c file. linter-clang is worked.
gcc --version
gcc (GCC) 5.3.0
Atom version is 1.6.0
linter-gcc version is 0.6.8
Console message:
linter-gcc: Using configuration page settings
linter-gcc config: {"execPath":"/usr/bin/gcc","gccIncludePaths":" ","gccSuppressWarnings":false,"gccDefaultCFlags":"-c -Wall","gccDefaultCppFlags":"-c -Wall -std=c++11","gccErrorLimit":0}
linter-gcc: /usr/bin/gcc -c -Wall -fmax-errors=0 /home/test/temp2/hex2dd.c
I've googled but can't figure out. Any help is much appreciated.
Thanks a lot.
Hi !
I'm trying linter-gcc for the first time using C++ (Used before for C, no problem), and it's making .o files in my home directory. (The same than the file i'm compiling). I hope it's not a dumb problem ^^
Here are my parameters:
I'm on ArchLinux. using GCC 5.3.0
By the way, i'm having .gch files while compiling .h files that are a bit redudant. Is it possible to delete them automagically ?
Thanks in advance, and sorry for the inconvenience.
Set my exec path to c:\tools\ARM-GCC\arm-none-eabi\bin where gcc.exe, ldd.exe, etc, is at. But no linting.
I'm on Windows 7 so I'm a bit lost as to how to debug this.
darwin
I installed
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.2.0
Thread model: posix
when I save my helloworld.c for linter to check the syntax, I got below error
errors=0'
error: unable open output file 'helloworld.o': 'Permission defied'
1 error generated.
I checked the command line in console, it is:
/usr/bin/gcc -c -Wall -std=gnu99 -fmax-errors=0 /myfolder/helloworld.c
I ran the command line in a terminal, helloword.o is generated in current folder.
this package was working in previous version of atom/linter/linter-gcc, but in this version it doesn't work.
could you check where did you set the default folder to compile the c program and from where do you read the .o file?
EDIT:
The error occurs with on-the-fly-linting disabled, too.
I also included another Stacktrace.
Hi,
I got a problem with on the fly linting and gcc-flags.json. I don't really know, if it depends ony my setup. But think it's not that exotic, so I decided to post in here.
If I don't use gccIncludePaths, obviously gcc can not find my header files: "RunMgr.hpp no such file or directory".
my setup: .gcc-flags.json in project directory, sourcefiles in .src/
./gcc-flags.json
./src/runMgr.cpp
./src/runMgr.hpp
with the following .json file, the first error is gone, but a big red atom "Uncaugt TypeError" pops up.
{
"gccIncludePaths": "./src"
}
I hope you/I can help you/me :)
GCC version: 4.9.2
Atom Version: 1.7.3
System: Ubuntu 15.04
Thrown From: linter-gcc package, v0.6.14
Uncaught TypeError: Cannot read property 'substring' of undefined
At /home/s5800160/.atom/packages/linter-gcc/lib/utility.js:101
TypeError: Cannot read property 'substring' of undefined
at Object.module.exports.buildCommand (/home/s5800160/.atom/packages/linter-gcc/lib/utility.js:101:16)
at Object.lint (/home/s5800160/.atom/packages/linter-gcc/lib/main.js:93:36)
at lintOnTheFly (/home/s5800160/.atom/packages/linter-gcc/lib/main.js:146:22)
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
at /usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1378:25
-0:09.3.0 grammar-selector:show (atom-text-editor.editor.is-focused)
-0:07.1.0 window:toggle-dev-tools (atom-text-editor.editor.is-focused)
-0:03.3.0 editor:newline (atom-text-editor.editor.is-focused)
{
"core": {
"disabledPackages": [
"build",
"activate-power-mode",
"atom-beautify",
"gpp-compiler"
],
"themes": [
"atom-dark-ui",
"one-dark-syntax"
]
},
"linter-gcc": {
"gccDebug": true,
"gccDefaultCFlags": "-Wall",
"gccDefaultCppFlags": "-std=c 11 -Wall",
"gccLintOnTheFly": true
}
}
# User
autocomplete-clang, v0.9.3
counter, v0.3.3
language-doxygen, v0.2.1
linter, v1.11.4
linter-clang, v3.4.4
linter-cppcheck, v0.2.0
linter-gcc, v0.6.14
# Dev
No dev packages
Atom Version: 1.7.3
System: Ubuntu 15.04
Thrown From: linter-gcc package, v0.6.14
Uncaught TypeError: Cannot read property 'substring' of undefined
At /usr/share/atom/resources/app.asar/src/pane.js:1002
TypeError: Cannot read property 'substring' of undefined
at Object.module.exports.buildCommand (/home/s5800160/.atom/packages/linter-gcc/lib/utility.js:101:16)
at Object.lint (/home/s5800160/.atom/packages/linter-gcc/lib/main.js:93:36)
at lintOnSave (/home/s5800160/.atom/packages/linter-gcc/lib/main.js:154:22)
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
at TextBuffer.module.exports.TextBuffer.saveAs (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1113:27)
at TextBuffer.module.exports.TextBuffer.save (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1083:19)
at TextEditor.module.exports.TextEditor.save (/usr/share/atom/resources/app.asar/src/text-editor.js:660:26)
at Pane.module.exports.Pane.saveItem (/usr/share/atom/resources/app.asar/src/pane.js:718:18)
at Pane.module.exports.Pane.saveActiveItem (/usr/share/atom/resources/app.asar/src/pane.js:701:19)
at Workspace.module.exports.Workspace.saveActivePaneItem (/usr/share/atom/resources/app.asar/src/workspace.js:684:35)
at atom-workspace.commandRegistry.add.core:save (/usr/share/atom/resources/app.asar/src/register-default-commands.js:214:32)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:260:29)
at /usr/share/atom/resources/app.asar/src/command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app.asar/src/window-event-handler.js:98:36)
at HTMLDocument.<anonymous> (/usr/share/atom/resources/app.asar/src/window-event-handler.js:3:61)
-0:27.4.0 editor:newline (atom-text-editor.editor.is-focused)
-0:26.7.0 core:save (atom-text-editor.editor.is-focused)
-0:24.3.0 core:backspace (atom-text-editor.editor.is-focused)
3x -0:23.4.0 core:save (atom-text-editor.editor.is-focused)
{
"core": {
"disabledPackages": [
"build",
"activate-power-mode",
"atom-beautify",
"gpp-compiler"
],
"themes": [
"atom-dark-ui",
"one-dark-syntax"
]
},
"linter-gcc": {
"gccDebug": true,
"gccDefaultCFlags": "-Wall",
"gccDefaultCppFlags": "-std=c++11 -Wall"
}
}
# User
autocomplete-clang, v0.9.3
counter, v0.3.3
language-doxygen, v0.2.1
linter, v1.11.4
linter-clang, v3.4.4
linter-cppcheck, v0.2.0
linter-gcc, v0.6.14
# Dev
No dev packages
By using atom-package-deps
you are able to install linter
automatically on activation. This will allow new Atom users to install only your package and nothing else, removing one step from the installation process.
Please see AtomLinter/linter-ruby#38 for example.
Trying to save a *.hpp
file and getting this error every time:
RangeError: Invalid string length
at Object.stringify (native)
at /Users/vision/.atom/packages/linter/lib/validate.coffee:53:25
at Array.forEach (native)
at Object.module.exports.Validate.messages (/Users/vision/.atom/packages/linter/lib/validate.coffee:27:14)
at MessageRegistry.set (/Users/vision/.atom/packages/linter/lib/message-registry.js:36:16)
at /Users/vision/.atom/packages/linter/lib/linter.coffee:35:17
at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
at /Users/vision/.atom/packages/linter/lib/indie-registry.js:27:20
at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
at Indie.setMessages (/Users/vision/.atom/packages/linter/lib/indie.js:15:18)
at /Users/vision/.atom/packages/linter-gcc/lib/main.js:75:35
For some reason, while saving header files in my C project, the linter is creating a "file.h.gch" file in the project tree.
This happens only for header files. C files don't generate anything.
Hello, I´m new to Atom and I´m loving it so far but I can´t get linter working with C, it always says "No issues", I dont know if it´s this package linter-gcc or linter itself, I´ve googled everywhere but I can´t find the solution.
Any help is much appreciated
Thanks!
gcc --version
into a terminal.linter
package installed, either update to the latest version of linter-gcc
or install linter directly with apm install linter
.I'm trying to include an environmental variable in the .gcc-flags.json
without success.
Current .gcc-flags.json
{
"execPath": "gcc",
"gccDefaultCFlags": "-Wall",
"gccDefaultCppFlags": "-Wall -std=c++11",
"gccErrorLimit": 15,
"gccIncludePaths": ".,$PATHTO\the\thing",
"gccSuppressWarnings": true
}
[Enter steps to reproduce below:]
Atom Version: 1.5.3
System: ALI-PC
Thrown From: linter-gcc package, v0.6.5
Uncaught TypeError: Cannot read property 'binary' of undefined
At C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\pane.js:825
TypeError: Cannot read property 'binary' of undefined
at Object.lint (C:/Users/Ali/.atom/packages/linter-gcc/lib/main.js:61:32)
at lintOnSave (C:/Users/Ali/.atom/packages/linter-gcc/lib/main.js:107:22)
at Function.module.exports.Emitter.simpleDispatch (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\event-kit\lib\emitter.js:125:28)
at TextBuffer.module.exports.TextBuffer.saveAs (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:1067:27)
at TextBuffer.module.exports.TextBuffer.save (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:1037:19)
at TextEditor.module.exports.TextEditor.save (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\text-editor.js:630:26)
at Pane.module.exports.Pane.saveItem (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\pane.js:545:18)
at Pane.module.exports.Pane.saveActiveItem (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\pane.js:528:19)
at Workspace.module.exports.Workspace.saveActivePaneItem (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\workspace.js:649:35)
at atom-workspace.commandRegistry.add.core:save (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\register-default-commands.js:173:32)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\command-registry.js:260:29)
at C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:536:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:359:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\window-event-handler.js:97:36)
at HTMLDocument.<anonymous> (C:\Users\Ali\AppData\Local\atom\app-1.5.3\resources\app.asar\src\window-event-handler.js:3:61)
-9:54.9.0 core:save (div.package-detail.panels-item)
-9:34.5.0 editor:newline (atom-text-editor.editor.is-focused)
-9:31.1.0 core:save (atom-text-editor.editor.is-focused)
-8:58.7.0 core:backspace (atom-text-editor.editor.is-focused)
2x -8:57.7.0 core:save (atom-text-editor.editor.is-focused)
{
"core": {
"disabledPackages": [
"minimap"
],
"themes": [
"atom-dark-ui",
"one-dark-syntax"
]
},
"linter-gcc": {
"execPath": "MinGW/bin/gcc"
}
}
# User
atom-html-preview, v0.1.13
autoclose-html, v0.20.0
autocomplete-html-entities, v0.1.0
autocomplete-python, v1.6.1
color-picker, v2.1.1
linter, v1.11.3
linter-gcc, v0.6.5
terminal-plus, v0.14.5
# Dev
No dev packages
Can someone help me I installed Atom new and i dont know what i did wrong.
Hi,
this package seems to be copying my .c source file to /tmp/ with an extension of .cpp.
My older gcc-4.6 is interpreting this file differently depending on the extension.
Can the file extension of the source file be preserved?
thanks
Hi, I just installed the gcc linter from the atom package manager, but the error stated in the title displays whenever the linter should be working. Did I do something wrong with the install of atom?
Linter-gcc fails to work for my C project. Instead, a single error is presented:
unable to open output file 'main.o': 'Permission denied'
Environment: Atom on MacOS X 10.11.2 (latest). Linter-Gcc v. 0.5.10
Log (from the Dev console):
linter-gcc trying: /Users/USER/rC/proj/src/.gcc-flags.json
/Users/USER/.atom/packages/linter-gcc/lib/config.js:33 linter-gcc trying: /Users/USER/rC/proj/.gcc-flags.json
/Users/USER/.atom/packages/linter-gcc/lib/main.js:124 linter-gcc: gcc -c -g -Wall -O3 -fmax-errors=0 -I/Users/USER/rC/proj -I/Users/USER/rC/proj/lib -I/Users/USER/rC/proj/tmp /Users/USER/rC/proj/src/main.c
Hey 😉
When I try to lint a header file (with extension .h), the linter will give me the following warning:
warning: #pragma once in main file
. When I switch to the default include guards, gcc will not output this error, however my project has over 100 header files and I don't want to switch from #pragma once
to the include guards.
Do you have any help? Thanks in advance.
Please help me run lint on the fly as it is not working.I have just installed and enabled the linter.
It is not working for .c file, .cc & .cpp files are okay.
So, after embarassing myself over here AtomLinter/linter-cpplint#38, I hope i'm doing the right thing this time, i'll copy and paste from that.
I have a package called language-cpp14 installed. I just installed because it sounds cool and seems to add some extra neat things, but I don't really know if I need it. I'm new to C++, so sorry if I'm not making any sense.
I have a perfectly valid C++ program using C++11 stuff. But since i've installed the language-cpp14 extension, the current language i'm using in Atom is also called C++14.
I know exactly where the problem lies: main.js, line 100:
if(grammar_name === "C++") {
flags = settings.gccDefaultCppFlags;
} else if(grammar_name === "C") {
flags = settings.gccDefaultCFlags;
}
I figured that grammar_name is C++14 so it doesn't use the flags. And throws over 5000 errors when I save the file, because it seems that G++ will default to the old c++.
I'm OK with using the normal C++ though, and that's what I'll do, probably. I was just wondering if that's a problem. Would that be correct to check whether grammar_name contains the string c++14?
gcc --version
into a terminal.linter
package installed, either update to the latest version of linter-gcc
or install linter directly with apm install linter
.When I compile my program with g++ myccfile.cc -std=c++11 -Wall, it works fine (all I get are a few warnings about unused functions). The clang linter shows the same warnings, but nothing else.
linter-gcc, however, shows me a ton of errors. In the .cc file I'm compiling, I'm getting a "No such file or directory" error on my first include (regardless of whether I add it to the include path). It's definitely the right file path because it compiles fine. The first error for the project as a whole is
"#error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.at line 32 col 2 in /usr/include/c++/4.8/bits/c++0x_warning.h".
despite the fact that I have -std=c++11 in my flags. There are also a number of warnings about the fact that I'm using C++11 reserved words (I'm using them for their intended purpose). I'm using the C++14 grammar (using the C++ grammar doesn't fix it).
Here are the debugging messages I get on the console when linter-gcc runs:
linter-gcc: Using configuration page settings
/home/emily/.atom/packages/linter-gcc/lib/utility.js:94 linter-gcc config: {"execPath":"/usr/bin/g++","gccIncludePaths":"./evo/, ./tools/","gccSuppressWarnings":false,"gccDefaultCFlags":"-std=c++11","gccDefaultCppFlags":"-c -std=c++11","gccErrorLimit":0,"gccErrorString":"error","gccWarningString":"warning","gccNoteString":"note"}
2/home/emily/.atom/packages/linter-gcc/lib/utility.js:76 Expanding directories
/home/emily/.atom/packages/linter-gcc/lib/utility.js:146 linter-gcc: /usr/bin/g++ -c -std=c++11 -fmax-errors=0 -I/home/emily/repos/Empirical/evo -I/home/emily/repos/Empirical/tools /tmp/5b9837c7-122b-4820-8092-d54549d3bf68.cpp
More information in case this is hard to duplicate:
Thanks so much! This otherwise seems like the best of the atom C++ linters.
I use MinGW in Windows, the path is C:\Windows. And I have added it in $PATH. How can I set the path to make it work? I tried: C:\MInGW\bin, /C:/MIngGW/bin.
Hello, I have encountered the following exception:
Atom Version: 1.7.2
System: linux 4.5.1-1-ARCH
Thrown From: linter-gcc package, v0.6.12
Uncaught TypeError: Path must be a string. Received undefined
At path.js:8
TypeError: Path must be a string. Received undefined
at assertPath (path.js:8:11)
at Object.posix.join (path.js:479:5)
at /home/bailly_j/.atom/packages/linter-gcc/lib/utility.js:66:34
at Array.forEach (native)
at Object.module.exports.splitStringTrim (/home/bailly_j/.atom/packages/linter-gcc/lib/utility.js:62:14)
at Object.module.exports.buildCommand (/home/bailly_j/.atom/packages/linter-gcc/lib/utility.js:132:40)
at Object.lint (/home/bailly_j/.atom/packages/linter-gcc/lib/main.js:92:36)
at lintOnTheFly (/home/bailly_j/.atom/packages/linter-gcc/lib/main.js:145:22)
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
at /usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1369:25
-0:07.5.0 grammar-selector:show (atom-text-editor.editor)
{
"core": {
"disabledPackages": [
"linter-clang"
]
},
"linter-gcc": {
"execPath": "gcc",
"gccDebug": true,
"gccDefaultCFlags": "-only -c -W -Wall -Wextra -pedantic -posix -o /dev/null",
"gccIncludePaths": "./include",
"gccLintOnTheFly": true
}
}
# User
epitech-headers, v0.2.8
epitech-norm-linter, v1.10.0
linter, v1.11.4
linter-gcc, v0.6.12
# Dev
No dev packages
In the .gcc-flags.json file, "gccIncludePaths" can get to be really long. When many libraries are stored under a single folder, e.g. the Arduino "libraries" folder, it would be useful to be able to specify the root folder and tell linter-gcc to recursively search all of the folders under that folder, instead of adding every sub-folder individually.
[Enter steps to reproduce below:]
Atom Version: 1.2.4
System: Unknown Windows Version
Thrown From: linter-gcc package, v0.5.0
Failed to activate the linter-gcc package
At Cannot find module 'atom-linter'
Error: Cannot find module 'atom-linter'
at Module._resolveFilename (module.js:336:15)
at Function.Module._resolveFilename (C:\Users\csd\AppData\Local\atom\app-1.2.4\resources\app.asar\src\module-cache.js:383:52)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.provideLinter (C:/Users/csd/.atom/packages/linter-gcc-0.5.0/lib/main.js:43:21)
at Package.module.exports.Package.activateServices (C:\Users\csd\AppData\Local\atom\app-1.2.4\resources\app.asar\src\package.js:327:69)
at Package.module.exports.Package.activateNow (C:\Users\csd\AppData\Local\atom\app-1.2.4\resources\app.asar\src\package.js:173:16)
at C:\Users\csd\AppData\Local\atom\app-1.2.4\resources\app.asar\src\package.js:150:32
at Package.module.exports.Package.measure (C:\Users\csd\AppData\Local\atom\app-1.2.4\resources\app.asar\src\package.js:92:15)
{
"core": {
"themes": [
"atom-material-ui",
"atom-material-syntax"
],
"disabledPackages": [
"linter-gcc",
"linter-gcc",
"linter-gcc",
"linter-gcc",
"linter-gcc"
]
}
}
# User
No installed packages
# Dev
No dev packages
This is such a great package with such an active user base. Would you like to join us over at @AtomLinter?
Joining us would ensure that your package is maintained if you ever lose interest or just get busy with other projects. As well, making sure that this is kept up to date with any API changes or improvements.
/cc @steelbrain
When I specify the standard I want to lint against in the Gcc Default C Flags
, the whole linter doesn't lint anything anymore.
I used this syntax :
-Wall -std=c90
With only -Wall
, a missing semi-colon shows up as an error. When adding -std=c90
, everything is reported as fine.
I don't have any code to test for C++.
Hello... I'm not sure if it is really an issue, however I couldn't find the answer in any other place.
I'm trying to use atom for coding my C projects (moving from eclipse). I've recently installed atom and platformio-ide packages (which includes linter-gcc, clang-autocomplete,etc) and it is all perfectly working (including my .gcc-flags.json file). However, an issue raised up:
Usually I don't put any header file (#include statements) in my header files. When am I dealing with some type from stdint.h (uint8_t for example), I just make sure that in my source file, the stdint.h file is being included before my header file. So, in atom, when I put some uintxx_t in my header file, the linter-gcc accuses an error: 'uint8_t' does not name a type.
So, having said that, can I remove these errors WITHOUT including the stdint.h in my header file? I'm sorry if it is a newbie question, but I've googled it for some time and I couldn't find any related issue.
SyntaxError: /home/guy/.atom/packages/linter-gcc/lib/main.js: Line 78: "file" is read-only
76 | editor = atom.workspace.getActivePaneItem();
77 | if (editor) {
78 | file = editor.buffer.file;
| ^
79 | if (file) {
80 | cwd = file.getParent().getPath();
81 | }
at File.errorWithNode (/opt/atom/resources/app.asar/node_modules/babel-core/lib/babel/transformation/file/index.js:451:13)
at checkPath (/opt/atom/resources/app.asar/node_modules/babel-core/lib/babel/transformation/transformers/es6/constants.js:33:16)
at NodePath.AssignmentExpression (/opt/atom/resources/app.asar/node_modules/babel-core/lib/babel/transformation/transformers/es6/constants.js:38:3)
at NodePath.call (/opt/atom/resources/app.asar/node_modules/babel-core/lib/babel/traversal/path/context.js:130:26)
at NodePath.visit (/opt/atom/resources/app.asar/node_modules/babel-core/lib/babel/traversal/path/context.js:154:8)
at TraversalContext.visitSingle (/opt/atom/resources/app.asar/node_modules/babel-core/lib/babel/traversal/context.js:92:12)
at TraversalContext.visit (/opt/atom/resources/app.asar/node_modules/babel-core/lib/babel/traversal/context.js:104:19)
at Function.traverse.node (/opt/atom/resources/app.asar/node_modules/babel-core/lib/babel/traversal/index.js:67:17)
at NodePath.visit (/opt/atom/resources/app.asar/node_modules/babel-core/lib/babel/traversal/path/context.js:171:26)
at TraversalContext.visitMultiple (/opt/atom/resources/app.asar/node_modules/babel-core/lib/babel/traversal/context.js:72:16)
Thanks a lot for this package! We use it for PlatformIO IDE.
We've received today an issue platformio/platformio-atom-ide#34 where user demonstrates invalid flags parser. I took a look at your code and found https://github.com/hebaishi/linter-gcc/blob/master/lib/main.js#L106. This is the place where bug is hidden.
For example, we have gccDefaultCppFlags
set to -flag1 -flag2 '-DUSER="Jhon Smith"' "-DCITY=\"John Smith\""
. Both defines are valid.
[Enter steps to reproduce below:]
{
"execPath": "arm-none-eabi-g++",
"gccIncludePaths": "./include"
}
Changing the execPath globally via the Settings pane works fine. If I change arm-none-eabi-gcc
to just gcc
, I get "gcc" not found as expected since gcc is not on my PATH but arm-none-eabi-gcc is
Atom Version: 1.5.4
System: Microsoft Windows 10 Education
Thrown From: linter-gcc package, v0.6.8
Uncaught TypeError: Cannot read property 'trim' of undefined
At C:\Users\Elliot\.atom\packages\linter-gcc\lib\utility.js:45
TypeError: Cannot read property 'trim' of undefined
at Object.module.exports.splitStringTrim (C:\Users\Elliot\.atom\packages\linter-gcc\lib\utility.js:45:14)
at Object.module.exports.buildCommand (C:\Users\Elliot\.atom\packages\linter-gcc\lib\utility.js:100:37)
at Object.lint (C:/Users/Elliot/.atom/packages/linter-gcc/lib/main.js:74:36)
at lintOnTheFly (C:/Users/Elliot/.atom/packages/linter-gcc/lib/main.js:124:22)
at Function.module.exports.Emitter.simpleDispatch (C:\Users\Elliot\AppData\Local\atom\app-1.5.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (C:\Users\Elliot\AppData\Local\atom\app-1.5.4\resources\app.asar\node_modules\event-kit\lib\emitter.js:125:28)
at C:\Users\Elliot\AppData\Local\atom\app-1.5.4\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:1321:25
-1:50.9.0 core:save (atom-text-editor.editor.is-focused)
3x -1:47.7.0 core:backspace (atom-text-editor.editor.autocomplete-active.is-focused)
-0:27.1.0 core:save (atom-text-editor.editor.is-focused)
2x -0:25 core:backspace (atom-text-editor.editor.autocomplete-active.is-focused)
-0:21.3.0 autocomplete-plus:cancel (atom-text-editor.editor.autocomplete-active.is-focused)
-0:19.7.0 core:cancel (a.stack-toggle)
4x -0:16.3.0 core:backspace (atom-text-editor.editor.autocomplete-active.is-focused)
-0:12.5.0 core:save (atom-text-editor.editor.is-focused)
2x -0:10.4.0 core:backspace (atom-text-editor.editor.autocomplete-active.is-focused)
3x -0:08.4.0 autocomplete-plus:cancel (atom-text-editor.editor.autocomplete-active.is-focused)
-0:06.0 core:cancel (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)
-0:04.4.0 core:move-up (atom-text-editor.editor.autocomplete-active.is-focused)
-0:04.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.autocomplete-active.is-focused)
2x -0:03.8.0 core:backspace (atom-text-editor.editor.autocomplete-active.is-focused)
-0:03.1.0 markdown-writer:insert-new-line (atom-text-editor.editor.autocomplete-active.is-focused)
-0:03.1.0 editor:newline (atom-text-editor.editor.autocomplete-active.is-focused)
{
"core": {
"audioBeep": false,
"autoHideMenuBar": true,
"disabledPackages": [
"color-picker",
"jekyll",
"language-cmake",
"pigments",
"symbols-view"
],
"themes": [
"one-dark-ui",
"base16-tomorrow-dark-theme"
]
},
"linter-gcc": {
"execPath": "arm-none-eabi-gcc",
"gccDebug": true,
"gccIncludePaths": "./include",
"gccLintOnTheFly": true
}
}
# User
atom-beautify, v0.28.26
atom-ctags, v4.5.0
file-icons, v1.6.18
language-doxygen, v0.2.1
linter, v1.11.3
linter-gcc, v0.6.8
markdown-writer, v2.3.2
minimap, v4.20.0
wakatime, v5.0.8
# Dev
No dev packages
I've got a CPP file which includes an H file. linter-gcc cannot find the header included in the H file at line 3. In Atom, it shows an error against line 3 of the CPP file against a different #include:
Header.h file:
#pragma once
#include <missing_header.h> <<<<<< No error shown here
...
CPP file:
#include "Header.h"
#include <AnotherHeader.h> <<<< Error shown here
...
Hello!
I would like to discuss a potential new feature - per-directory and per-file settings. Would any of these be at all possible and wanted? I would certainly appreciate a feature like that - in bigger projects I quite often have additional flags for some folder trees, sometimes there's a need to have specific compiler flags for some selected source files.
The first variant - per-directory - would probably fit well with the concept of .gcc-flags.json file. Personally I imagine a feature like that would apply flags from .gcc-flags.json file to files in this folder and all subfolders. I suppose that top-level .gcc-flags.json file should provide "global" settings and .gcc-flags.json files in other folders could append some other flags (in case of gccDefaultCFlags, gccDefaultCppFlags and gccIncludePaths) or override values (in case of execPath, gccErrorLimit and gccSuppressWarnings). However it would be nice if there would be a switch that would allow all settings to be overridden. I guess this could take a form of different name of the file with settings - for example .gcc-flags-top.json would contain "top-level" options - no file "above" this one would need to be parsed.
The second variant - per-file - seems a little more complicated to fit nicely with the files with settings, but I guess this would also be possible.
.icon-right::before
css selector will be replaced by .linter-gutter
of the new linter gutter element.
For more details: steelbrain/linter#906
The line:
struct mip_frame *frame = malloc(msg_size);
gives error:
invalid conversion from ‘void*’ to ‘mip_fram*’ [-fpermissive]
The file is a .c file. And when compiled with gcc from a terminal windows, it gives no errors.
I have the following flags for linter-gcc: -c -Wall
I have correctly the Exec Path to match the location of g++ (mingw-w64) on my Windows 10 machine:
C:/Program Files/mingw-w64/x86_64-5.1.0-posix-seh-rt_v4-rev0/mingw64/bin/g++
However, the linter always reports "No Issues."
Alternatively, if I startup Atom with the g++ directory in the system path, the linter correctly detect errors. It seems that the Exec Path setting is not working?
I have windows 10, cpp project, i have set correct path to compiler "C:\Qt\Tools\mingw492_32\bin\g++", added it to the system path varible, base linter is installed.
And nothing happens... 0 issues in bottom deck, in console panel i also don't see anything.
Did i forgot anything to make linter work?
If you start working on a project that does not have a .gcc-flags.json
file after working on one that does, it'll use the configuration from the previous project. This appears to be a permanent modification to the user's settings (through atom.config.set
).
config.js
also sets every attribute from the config file, even if some aren't present. This means that omitting execPath
from .gcc-flags.json
to let the user use their own, correct path will reset execPath
to the default (/usr/bin/g++
).
[Enter steps to reproduce below:]
Atom Version: 1.7.3
System: Debian GNU/Linux
Thrown From: linter-gcc package, v0.6.14
Uncaught SyntaxError: /home/hgst/dev/mp/.gcc-flags.json: Unexpected string
At /usr/share/atom/resources/app.asar/src/pane.js:1002
SyntaxError: /home/hgst/dev/mp/.gcc-flags.json: Unexpected string
at Object.parse (native)
at Object.Module._extensions..json (module.js:440:27)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
at Object.module.exports.settings (/home/hgst/.atom/packages/linter-gcc/lib/config.js:49:25)
at Object.module.exports.buildCommand (/home/hgst/.atom/packages/linter-gcc/lib/utility.js:91:23)
at Object.lint (/home/hgst/.atom/packages/linter-gcc/lib/main.js:93:36)
at lintOnSave (/home/hgst/.atom/packages/linter-gcc/lib/main.js:154:22)
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
at TextBuffer.module.exports.TextBuffer.saveAs (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1113:27)
at TextBuffer.module.exports.TextBuffer.save (/usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1083:19)
at TextEditor.module.exports.TextEditor.save (/usr/share/atom/resources/app.asar/src/text-editor.js:660:26)
at Pane.module.exports.Pane.saveItem (/usr/share/atom/resources/app.asar/src/pane.js:718:18)
at Pane.module.exports.Pane.saveActiveItem (/usr/share/atom/resources/app.asar/src/pane.js:701:19)
at Workspace.module.exports.Workspace.saveActivePaneItem (/usr/share/atom/resources/app.asar/src/workspace.js:684:35)
at atom-workspace.commandRegistry.add.core:save (/usr/share/atom/resources/app.asar/src/register-default-commands.js:214:32)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:260:29)
at /usr/share/atom/resources/app.asar/src/command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app.asar/src/window-event-handler.js:98:36)
at HTMLDocument.<anonymous> (/usr/share/atom/resources/app.asar/src/window-event-handler.js:3:61)
-0:23.8.0 core:copy (atom-text-editor.editor.is-focused)
-0:11.3.0 editor:newline (atom-text-editor.editor.is-focused)
-0:10.6.0 core:paste (atom-text-editor.editor.is-focused)
-0:05.0 core:move-left (atom-text-editor.editor.is-focused)
-0:04.9.0 snippets:next-tab-stop (atom-text-editor.editor.is-focused)
-0:04.9.0 snippets:expand (atom-text-editor.editor.is-focused)
-0:04.9.0 editor:indent (atom-text-editor.editor.is-focused)
-0:00.4.0 core:save (atom-text-editor.editor.is-focused)
{
"core": {
"audioBeep": false,
"disabledPackages": [
"autocomplete-ctags",
"language-ruby",
"language-ruby-on-rails",
"language-sass",
"language-php",
"language-perl",
"language-objective-c",
"language-mustache",
"language-javascript",
"language-java",
"language-toml",
"language-yaml",
"open-on-github",
"atom-rtags",
"atomic-rtags",
"symbols-view",
"epitools"
]
},
"linter-gcc": {
"execPath": "/usr/bin/gcc",
"gccDefaultCFlags": "-c -Wall -fsyntax-only",
"gccDefaultCppFlags": "-c -Wall -fsyntax-only"
}
}
# User
atom-ctags, v4.5.2
linter, v1.11.4
linter-gcc, v0.6.14
terminal-plus, v0.14.5
# Dev
No dev packages
gcc --version
into a terminal.linter
package installed, either update to the latest version of linter-gcc
or install linter directly with apm install linter
.Windows user here.
The linter is giving me an error on this very basic program that it can't find <iostream>
.
My GCC Executable Path is C:\MinGW\bin\g++.exe
.
Using that very same path to compile my program using the commandline (g++ main.cpp
) works perfectly.
Any help is appreciated.
[Enter steps to reproduce below:]
Atom Version: 1.8.0-beta3
System: Ubuntu 12.04.4
Thrown From: linter-gcc package, v0.6.14
Uncaught Error: ENOENT: no such file or directory, scandir '/home/local/DOMAIN2003/test50/git/include -I/usr/include/libxml2'
At /usr/local/share/atom-beta/resources/app.asar/src/pane.js:1002
Error: ENOENT: no such file or directory, scandir '/home/local/DOMAIN2003/test50/git/include -I/usr/include/libxml2'
at Error (native)
at Object.fs.readdirSync (fs.js:856:18)
at Object.fs.readdirSync (ATOM_SHELL_ASAR.js:497:28)
at Object.module.exports.walkSync (/home/local/DOMAIN2003/test50/.atom/packages/linter-gcc/lib/utility.js:15:16)
at /home/local/DOMAIN2003/test50/.atom/packages/linter-gcc/lib/utility.js:75:37
at Array.forEach (native)
at Object.module.exports.splitStringTrim (/home/local/DOMAIN2003/test50/.atom/packages/linter-gcc/lib/utility.js:66:14)
at Object.module.exports.buildCommand (/home/local/DOMAIN2003/test50/.atom/packages/linter-gcc/lib/utility.js:136:40)
at Object.lint (/home/local/DOMAIN2003/test50/.atom/packages/linter-gcc/lib/main.js:93:36)
at lintOnSave (/home/local/DOMAIN2003/test50/.atom/packages/linter-gcc/lib/main.js:154:22)
at Function.module.exports.Emitter.simpleDispatch (/usr/local/share/atom-beta/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/usr/local/share/atom-beta/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
at TextBuffer.module.exports.TextBuffer.saveAs (/usr/local/share/atom-beta/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1113:27)
at TextBuffer.module.exports.TextBuffer.save (/usr/local/share/atom-beta/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1083:19)
at TextEditor.module.exports.TextEditor.save (/usr/local/share/atom-beta/resources/app.asar/src/text-editor.js:660:26)
at Pane.module.exports.Pane.saveItem (/usr/local/share/atom-beta/resources/app.asar/src/pane.js:718:18)
at Pane.module.exports.Pane.saveActiveItem (/usr/local/share/atom-beta/resources/app.asar/src/pane.js:701:19)
at Workspace.module.exports.Workspace.saveActivePaneItem (/usr/local/share/atom-beta/resources/app.asar/src/workspace.js:684:35)
at atom-workspace.commandRegistry.add.core:save (/usr/local/share/atom-beta/resources/app.asar/src/register-default-commands.js:214:32)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/local/share/atom-beta/resources/app.asar/src/command-registry.js:260:29)
at /usr/local/share/atom-beta/resources/app.asar/src/command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/local/share/atom-beta/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/local/share/atom-beta/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/usr/local/share/atom-beta/resources/app.asar/src/window-event-handler.js:98:36)
at HTMLDocument.<anonymous> (/usr/local/share/atom-beta/resources/app.asar/src/window-event-handler.js:3:61)
-0:00.9.0 core:save (atom-text-editor.editor.is-focused)
{
"core": {
"disabledPackages": [
"vim-mode",
"activate-power-mode"
],
"themes": [
"atom-material-ui",
"atom-material-syntax"
]
},
"linter-gcc": {
"gccIncludePaths": ".,../,./include,../include -I/usr/include/libxml2/*"
}
}
# User
atom-beautify, v0.29.7
atom-material-syntax, v0.4.6
atom-material-ui, v1.2.11
autocomplete-paths, v1.0.2
docblockr, v0.7.3
emmet, v2.4.3
esformatter, v1.25.0
file-icons, v1.7.11
highlight-selected, v0.11.2
linter, v1.11.4
linter-gcc, v0.6.14
merge-conflicts, v1.4.2
minimap, v4.23.5
minimap-bookmarks, v0.3.1
minimap-find-and-replace, v4.5.1
minimap-highlight-selected, v4.4.0
minimap-selection, v4.4.0
pigments, v0.26.2
simplified-chinese-menu, v3.4.11
sync-settings, v0.7.2
terminal-plus, v0.14.5
# Dev
No dev packages
Hello!
I've been trying for a while , without success, to make linter-gcc lint on the fly, not only on save. Is it not a possible feature at this moment? It works fine at file save, but not on the fly. The python linter-flake8 , for example works on the fly. But not the gcc version, nor the javac one but that's another issue.
I have linter 1.11.4 and linter-gcc 0.6.8 on Atom 1.6.0. Also, here is the output from gcc --version:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.2.0
Thread model: posix
I am new to Atom/PlatformIO but have got everything basically working in that I can compile projects, upload Arduinos, etc with no problems. But I am having problems with lint. This is what I see:
#1 Lint reports issues to line numbers that do not exist. These, of course, are all beyond the last line in the file.
#2 Lint is reporting errors that are flagged at lines that have no code or can't possibly have the errors indicated.
There are no messages from the console, I have tried various installs and updates, but to no avail.
The attached png shows lint pointing into the middle of some comments delineated by /* */
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.