-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Build broken on 32 bit systems #1175
Comments
Related to #985. |
Yes absolutely - this must clearly be addressed. |
Actually there is such an attempt in
|
Well the check seems correct, but you still have to put the cast in. That is, you have to write
to communicate to the compiler that you acknowledge the reduction in range. Also, the correct macro to check against is of course |
I see, however I must admit this is not part of any own implementation, I just got aware of this one being present. |
Unfortunately I only have FreeBSD machines to test, but I'll go ahead and give it a try. |
@clausecker Have you had the chance for a test in the meanwhile? |
Sorry, had a very stressful week. Will test it today. |
I can confirm that with the cast added, the current |
Oh, that's good news. 👍 |
The build of 1.7.0 on armv7 FreeBSD 13.0-RELEASE still fails as reported in bug #629. The issue reported there was never actually fixed. This concerns this line of code:
The problem is that while files are allowed to be very large, there is only a 32 bit address space on 32 bit machines. So
size_t
(for sizes of objects) is a 32 bit type whileoff_t
(for sizes of files) is a 64 bit type. The correct resolution of this issue is to check ifst.st_size
is larger thanSIZE_MAX
(the largest possiblesize_t
). If it is, an error must be returned immediately as the file is too large to be mapped. Ifst.st_size <= SIZE_MAX
, a cast tosize_t
will not change the value and is thus correct to perform.Please consider applying such a patch for 1.7.1.
The text was updated successfully, but these errors were encountered: