Comments (5)
But keep them as just warnings when not in the CI, that way users will not get errors if they upgrade a compiler that introduces some new warnings.
from cpp-terminal.
I have checked on that:
https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Option-Summary.html
There are many warnings available. We would have to test them with both clang and gcc on at least windows and linux. I would suggest doing that after we moved the library into seperate files, because we can turn on the warnings and errors on the library tearget directly (wich improves the debugging a lot).
I would also suggest to add all flags, that disable non-c++ stuff, like gnu keywords and disable stuff like "weak functions".
The abbility to turn off the compile options could be done with the same cmake options, that can turn off the example program targets. That would be a good thing to include in the wiki later on (like a simple compile with cmake section. But I would prefer to make it optional and not recommended).
Also the sompile flags are only turned on on the specified targets. That means, that projects that depend on cpp-terminal don't use the extra flags at all (only if they are adding those themselves) but cpp-terminal gets compiled with those independently.
I'll create a list with all compile flags, I would suggest / recommend. We can decide then, what we use and what not. As I said, I would probably use all that are either regarding to C++ or x64/x86 architectures. (Are we even supporting x32? and / or other ones like arm64/aarch64/armV7 and so on?).
from cpp-terminal.
I havent looked for MSVC yet. Will do that probably after we implemented the flags for linux / gcc. We have to do both seperately anyway.
from cpp-terminal.
I have looked into it. There are many warning that we shouldn't enable, like -Wdouble-promotions, because it warns of a problem that occurs on really old 32bit pcs. So I wouldn't go with -w (wich enables all warnings). I created a list and will will go into that later.
-fno-gnu-keywords
-Wabi-tag
-Wcomma-subscript
-Wctor-dtor-privacy
-Wall
-Wextra
-Wnoexcept
-Wnoexcept-type
-Wclass-memaccess
-Wregister
-Wredundant-tags
-Wstrict-null-sentinel
-Wold-style-cast
-Woverloaded-virtual
-Wsign-promo
-Wtemplates
-Wmismatched-tags
-Wmultiple-inheritance
-Wvirtual-inheritance
-Wvolatile
-Wzero-as-null-pointer-constant
-Wextra-semi
-Wsuggest-final-types
-Wuseless-cast
-Wnull-dereference
-fdelete-null-pointer-checks
-Wmissing-include-dirs
-Wswitch-default
-Wuninitialized
-Wunused-macros
-Wundef
-Winline
// limits max errors
-fmax-errors=30
// all warnings to errors
-Werror
// only allow ISO c++
-Wpedantic
Needs testing:
// may argue about standard headers
-Weffc++
// maybe too strict
-Wunused-const-variable=2
-Wswitch-enum
-Wcatch-value=3
-Waligned-new=all
-Wconditionally-supported
-Wsuggest-final-methods
-Wsuggest-override
-Wformat=2
-Wformat-overflow=2
-Wformat-nonliteral
-Wformat-security
-Wformat-signedness
-Wformat-truncation=2
-Wformat-y2k
-Wshift-overflow=2
-Wstrict-overflow=5
-Wshadow
-Wunsafe-loop-optimizations
// Warn about code affected by ABI changes and I don't understand what that is.
-Wabi
And some analysing (haven't used that yet, can't tell if it's to be used at compiletime or just for checking, like clang-tidy does):
-Wanalyzer-too-complex
-fanalyzer
-fanalyzer-call-summaries
-fanalyzer
-fanalyzer-call-summaries
-fanalyzer-checker=name
-fanalyzer-fine-grained
-fanalyzer-state-merge
-fanalyzer-state-purge
-fanalyzer-transitivity
-fanalyzer-verbose-edges
-fanalyzer-verbose-state-changes
-fdump-analyzer
-fdump-analyzer-stderr
-fdump-analyzer-callgraph
-fdump-analyzer-exploded-graph
-fdump-analyzer-exploded-nodes-3
-fdump-analyzer-state-purge
-fdump-analyzer-supergraph
Hope that works. I have not included warnings, that are turned on by -Wall and -Wextra. Also I have included no C related options.
from cpp-terminal.
replaced by #182.
from cpp-terminal.
Related Issues (20)
- Color are wrong with unicode characters on Windows HOT 2
- Flickering HOT 20
- Windows terminal can be turned into `legacy mode` and so crash our ANSII support detection
- example 'kilo' does not support special characters HOT 7
- exception leaking destructor is dangerous HOT 10
- build as shared library, error adding symbols: DSO missing from command line HOT 12
- Compiling the examples with GCC results in errors HOT 7
- Create a list of projects that are using this library HOT 3
- Bug: cpp-terminal crashes if two utf8 are inserted simultaneously HOT 42
- Multiline prompt stopped working on macOS
- Ctrl + I and Tab HOT 6
- Bug: Text Wrap Incompatibility HOT 6
- Bring back the list of other similar libraries HOT 4
- Pressing Ctrl, Alt, Shift creates a copy paste event on windows? HOT 3
- Addition of Metakey and Key results in warning of deprecation HOT 1
- Bug in key + metakey arithmetic HOT 7
- Exception thrown at this line when typeing to fast HOT 7
- mouse sending random characters to the terminal after examples/minimal ends HOT 8
- `std::cin` doesn't read pipe redirection HOT 8
- Issue with file headers HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp-terminal.