by msim · 10y ago · 0 comments
warning: cast from '...' to '...' increases required alignment from 1 to X [-Wcast-align]
warning: declaration shadows a field of '...' [-Wshadow]
warning: declaration shadows a local variable [-Wshadow]
warning: implicit conversion changes signedness: '...' to '...' [-Wsign-conversion]
warning: implicit conversion loses integer precision: '...' to '...' [-Wconversion]
warning: implicit conversion loses integer precision: '...' to '...' [-Wshorten-64-to-32]
warning: macro name is a reserved identifier [-Wreserved-id-macro]
warning: no previous prototype for function '...' [-Wmissing-prototypes]
warning: operand of ? changes signedness: 'int' to 'char' [-Wsign-conversion]
warning: unused parameter '...' [-Wunused-parameter]
warning: use of old-style cast [-Wold-style-cast]
Use with caution!There is a reason for these not to be enabled by default.
* Unused parameter -> rly? Who gives a damn? * Use of old style cast -> Well I'm old style, get over it. * No previous prototype declaration -> Again, I do this if I want to. * Shadows field -> who cares? No me. * Cast increases required alignment -> Well, obviously the perf cost is not an issue here. * Etc, etc, etc
These are pedantic warnings. However, this is an open source prject and you are free to send me PR's whenever you want.
There's no excuse for using c-style casting in C++ considering the depth of the different casts we as developers have at our disposal.
Additionally, I just looked at the code, and is there any reason it's all stuffed into a single header and source file? I don't know if I'm just being naive, but isn't this a slightly bad design? There seem to be a lot of different data structures that could easily be broken out and make it a bit easier to follow the flow of the project.
The code screams security vulnerability and I'm not only talking about the warnings.
I'm a big fan of Wall Werror with pragma for specific sections where you must work around the warnings. Does a great job of catching issues with contributions.
"By using Linux I haven't been limited by the lacking Microsoft C++ compilers only supporting a fraction of the language, but instead been able to use the very latest features and tools."
Don't C++ compilers give lots of unimportant warnings?