{"id":19682325,"url":"https://github.com/sublimelinter/sublimelinter-gcc","last_synced_at":"2025-04-29T05:30:27.632Z","repository":{"id":77913091,"uuid":"81083428","full_name":"SublimeLinter/SublimeLinter-gcc","owner":"SublimeLinter","description":"This linter plugin for SublimeLinter provides an interface to gcc or other gcc-like (cross-)compiler.","archived":false,"fork":false,"pushed_at":"2024-04-16T14:07:12.000Z","size":119,"stargazers_count":25,"open_issues_count":0,"forks_count":5,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-26T08:37:44.558Z","etag":null,"topics":["c","cpp","gcc","linter-plugin","sublime-text","sublimelinter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SublimeLinter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-06T12:08:21.000Z","updated_at":"2024-11-26T06:40:07.000Z","dependencies_parsed_at":"2024-11-11T18:10:23.797Z","dependency_job_id":"ebca8f78-31e7-48b2-8bc0-996bbc71c8b8","html_url":"https://github.com/SublimeLinter/SublimeLinter-gcc","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeLinter%2FSublimeLinter-gcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeLinter%2FSublimeLinter-gcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeLinter%2FSublimeLinter-gcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeLinter%2FSublimeLinter-gcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SublimeLinter","download_url":"https://codeload.github.com/SublimeLinter/SublimeLinter-gcc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251444055,"owners_count":21590405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cpp","gcc","linter-plugin","sublime-text","sublimelinter"],"created_at":"2024-11-11T18:10:21.545Z","updated_at":"2025-04-29T05:30:27.297Z","avatar_url":"https://github.com/SublimeLinter.png","language":"Python","readme":"# SublimeLinter-gcc\n\n[![Package Control](https://img.shields.io/packagecontrol/dt/SublimeLinter-gcc?style=flat-square)](https://packagecontrol.io/packages/SublimeLinter-gcc)\n[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/SublimeLinter/SublimeLinter-gcc?style=flat-square\u0026logo=github)](https://github.com/SublimeLinter/SublimeLinter-gcc/tags)\n[![Project license](https://img.shields.io/github/license/SublimeLinter/SublimeLinter-gcc?style=flat-square\u0026logo=github)](https://github.com/SublimeLinter/SublimeLinter-gcc/blob/master/LICENSE)\n[![GitHub stars](https://img.shields.io/github/stars/SublimeLinter/SublimeLinter-gcc?style=flat-square\u0026logo=github)](https://github.com/SublimeLinter/SublimeLinter-gcc/stargazers)\n[![Donate to this project using Paypal](https://img.shields.io/badge/paypal-donate-blue.svg?style=flat-square\u0026logo=paypal)](https://www.paypal.me/jfcherng/5usd)\n\nThis linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter)\nprovides an interface to [gcc](https://gcc.gnu.org/) or other gcc-like (cross-)compiler.\nIt will be used with files that have the C/C++ syntax.\nIf you are using [clang](https://clang.llvm.org), you may want to check\n[SublimeLinter-clang](https://github.com/SublimeLinter/SublimeLinter-clang).\n\n\n## Installation\n\nSublimeLinter must be installed in order to use this plugin.\nIf SublimeLinter is not installed, please follow the instructions\n[here](https://sublimelinter.readthedocs.org/en/stable/installation.html).\n\n\n### Linter installation\n\nBefore using this plugin, you must ensure that `gcc` or other gcc-like compiler is installed on your system.\n\nYou may install `gcc` with the following method:\n\n- Mac OS X: [OSX GCC Installer](https://github.com/kennethreitz/osx-gcc-installer)\n- Linux: `gcc` could be installed by using most package managers.\n- Windows: [MinGW-w64](https://sourceforge.net/projects/mingw-w64)\n\nOnce `gcc` is installed, you must ensure it is in your system PATH so that SublimeLinter can find it.\nThis may not be as straightforward as you think, so please read [Debugging PATH problems](https://sublimelinter.readthedocs.org/en/stable/troubleshooting.html#debugging-path-problems) in the documentation.\n\n\n### Plugin installation\n\nPlease use [Package Control](https://sublime.wbond.net/installation) to install the linter plugin.\nThis will ensure that the plugin will be updated when new versions are available.\nIf you want to install from source so you can modify the source code,\nyou probably know what you are doing so we won't cover that here.\n\nTo install via Package Control, do the following:\n\n1. Within Sublime Text, bring up the `Command Palette` by \u003ckbd\u003eCtrl + Shift + P\u003c/kbd\u003e and type `install`.\n   Among the commands you should see `Package Control: Install Package`.\n   If that command is not highlighted, use the keyboard or mouse to select it.\n   There will be a pause of a few seconds while Package Control fetches the list of available plugins.\n\n1. When the plugin list appears, type `gcc`. Among the entries you should see `SublimeLinter-gcc`.\n   If that entry is not highlighted, use the keyboard or mouse to select it.\n\n\n## Settings\n\nHere are some most frequently used custom settings.\n\n| Setting | Description |\n| :------ | :---------- |\n| executable | The compiler's binary path. This is `[\"gcc\"]` or `[\"g++\"]` by default. If you are not using them, you have to set this to your compiler binary such as `[\"arm-none-eabi-gcc\"]`. |\n| I | A list of directories to be added to the header's searching paths. I.e., paths for `-I` flags. |\n| args | A list of extra flags to be passed to the compiler. These should be used carefully as they may cause linting to fail. |\n\n\nHere is an example settings:\n\n```javascript\n{\n    \"linters\":\n    {\n        \"gcc\": {\n            \"disable\": false,\n            \"executable\": [\"gcc\"],\n            \"args\": [\"-fsyntax-only\", \"-std=c90\"],\n            \"I\": [\n                \"${file_path}/include\",\n                \"${folder}/include\",\n                \"/usr/local/include\",\n            ],\n            \"excludes\": [],\n        },\n        \"g++\": {\n            \"disable\": false,\n            \"executable\": [\"g++\"],\n            \"args\": [\"-fsyntax-only\", \"-std=c++20\"],\n            \"I\": [\n                \"${file_path}/include\",\n                \"${folder}/include\",\n                \"/usr/local/include\",\n            ],\n            \"excludes\": [],\n        },\n    },\n}\n```\n\nHere are some useful docs for SublimeLinter settings.\n\n- [General information on how SublimeLinter works with settings](https://sublimelinter.readthedocs.org/en/stable/settings.html).\n- [Variables that can be used in settings](https://sublimelinter.readthedocs.org/en/stable/settings.html#settings-expansion).\n- [Information on generic linter settings](https://sublimelinter.readthedocs.org/en/stable/linter_settings.html).\n\n\n## Notes\n\n- [Here](https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Warning-Options.html#Warning-Options)\n  is the official list of warning options in gcc 13.2.0. I prefer turn on all warnings\n  via `-Wall` (this is default for this plugin) and then suppress unwanted warnings via `-Wno-` prefix.\n\n- Use the `-fsyntax-only` flag in `args` gives a much faster syntax-only checking but\n  [some warnings](https://github.com/SublimeLinter/SublimeLinter-gcc/issues/4)\n  which are emitted in the code optimization phase would not be caught.\n\n\n## Demo\n\n![linting_example](https://raw.githubusercontent.com/SublimeLinter/SublimeLinter-gcc/gh-pages/images/linting_example_sl4.png)\n\n\n## Troubleshooting\n\nC/C++ linting is not always straightforward.\nA few things to try when there's (almost) no linting information available:\n\n- Try to compile from the command line, and verify it works.\n- The linter might be missing some header files. They can be added with settings `I`.\n- Sometimes gcc fails to locate the C/C++ standard library headers.\n\nAssuming the compilation works when executed via command line, try to compile with `g++ -v`.\nThis will display all of the hidden flags that gcc uses.\nAs a last resort, they can all be added in settings `args`.\n\n\n## Contributing\n\nIf you would like to contribute enhancements or fixes, please do the following:\n\n1. Fork the plugin repository.\n1. Hack on a separate topic branch created from the latest `master`.\n1. Commit and push the topic branch.\n1. Make sure your modification could pass unittests.\n1. Make a pull request.\n1. Be patient.\n\nPlease note that modifications should follow these coding guidelines:\n\n- Indent is 4 spaces.\n- Code should pass flake8 and pep257 linters.\n- Probably format codes with [black](https://github.com/psf/black) code formatter.\n- Vertical whitespace helps readability, don’t be afraid to use it.\n- Please use descriptive variable names, no abbreviations unless they are very well known.\n\nThank you for helping out!\n","funding_links":["https://www.paypal.me/jfcherng/5usd"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsublimelinter%2Fsublimelinter-gcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsublimelinter%2Fsublimelinter-gcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsublimelinter%2Fsublimelinter-gcc/lists"}