3 ms·
So you enabled pedantic warning level, and you got a bunch of pedantic nonsense warnings. There is a reason for these not to be enabled by default. * Unused p
by alexhultman 10y ago
So you enabled pedantic warning level, and you got a bunch of pedantic nonsense warnings.
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.
- jguegant 10y ago"Use of old style cast -> Well I'm old style, get over it." "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."
- msim 10y agoIt's funny that you don't mention the warnings that can be security vulnerabilities, like integer precision/signedness. The code screams security vulnerability and I'm not only talking about the warnings.
- vvanders 10y agoYep, I seem to recall there was one in MySQL a while back that just involved a simple int->char conversion where the overflow would trigger a match due to a random seed that was involved in the password path. 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.
- clappski 10y agoMaybe using a `reinterpret_cast` would actually have better performance. A C-style cast tries to do a bunch of casts in order, starting with a static and ending with reinterpret (see http://anteru.net/blog/2007/12/18/200/ http://anteru.net/blog/2007/12/18/200/). 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.