Closed frispete closed 3 years ago
Thanks. I've noticed similar warnings from Clang (on Travis) and CLion. I'll address this in an upcoming release.
Unfortunately, most of the standard C functions take signed chars as their inputs, and the character transliteration logic in detox needs unsigned chars to work properly.
The code works with the implicit casts; I'll probably go with explicit casts in the v1 series and introduce more breaking changes in a major release.
Yeah, this is big, and potentially breaking. I'll address it in v2.0.0.
I feel with you.
My C brain is rusty at best, but maybe a set of wrapper macros/functions for the standard c functions with the correct casts in place would be the shortest path to success.
Hey, Doug, you're my hero of the day!
Thank you so much. Your approach to stick with signed chars and deal with the fallout is far superior to anything else.
Thanks @frispete ! I looked at your suggestion of creating wrappers around the standard C library, too, but ended up going with this approach when I realized it was only one of the filters that was failing, and I could fix it easily.
I also incorporated some of the gcc flags I saw from your output, adding protections against overflows and overruns. I like those a lot.
Thank you very much for the push in the right direction!
Dear Doug,
thanks for providing and sharing this nice tool. I discovered it today, thanks to an article in the c't, a highly regarded computer magazine here in Germany. In order to spread the joy, I packaged v1.3.3 for openSUSE right away here, in such a way, that it's ready for entering the official distribution, building on the blocks from Antoine Ginies. During that course, I noticed a lot of rather disturbing compiler complaints during build:
You can see the full build log by clicking on the succeeded link.
Yes, our compilers are parameterized quite squeamishly, but it often helps to discover issues early. That doesn't work so well anymore, if a project triggers that many warnings, though...
Of course, we could muzzle the compiler, but it would be nice, if you could take a look into this issue yourself. I'm sure, eliminating these signedness issues improves the overall value of this fine project even more.