-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue] gcc 14.2.1 warning #277
Comments
Hello, Thanks for reporting the issue. I've tried the suggested fix which does not break the tests, but I'm wondering if that's a good fix. In all the documentation I can find, it says that I'm not suggesting it's a compiler bug but... Could it be a compiler bug? Or more seriously, is there some |
Hi, Nevertheless you are right, /usr/include/strings.h memcpy prototype is
So, size_t (unsigned), not ssize_t (signed) For this kind of issues, I don't add -Werror in my projects, even if i fully agree that authors must take care of warnings |
I've pushed the fix in the branch gcc-14.2.1-warning for now. If the warning persists in the next gcc versions or appear in more cases, I'll merge the branch with master. I'll leave this issue open for now. |
Hello @LaurentThomas , I've seen this issue in other environments (Debian testing and Ubuntu 24.04 now). Although, for some reason, the warning is raised when I don't know which one is right (I'm still wondering about the |
Hi,
gcc 14.2.1 refuse to compile:
The warning is quite bad, it says you test: if (data_len_in && data_len_in <= (SIZE_MAX-4))
but memcpy() max size is SSIZE_MAX (that is smaller)
possible fix:
add #include <limits.h> and change the if to SSIZE_MAX
The text was updated successfully, but these errors were encountered: