Closed ibbem closed 2 years ago
Agreed. The checks look harmless but useless.
Are you planing to publish these fixes in a new release any time soon? Would be nice to have these changes available via conan.io
Yes, it does seem about time to put out a fresh release.
I think this code tried to check for a zero terminated null byte, but it actually just checked if the address of the corresponding character is non-zero, which is always true. These broken checks are simply dropped because the following code assumes that the string
b
doesn't include a null byte and all call sites already pass the length of the string without counting the null byte.This bug was found by gcc 12.1 which emits a warning on this kind of code. Now glew builds without any warnings using gcc 12.1. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102103 for the corresponding issue.