[File] Error on 32bit for file 5.45

Christos Zoulas christos at zoulas.com
Mon Jul 31 15:56:22 UTC 2023


Committed, thanks!

christos

> On Jul 31, 2023, at 3:51 AM, Dr. Werner Fink <werner at suse.de> wrote:
> 
> Signed PGP part
> On 2023/07/28 10:38:11 -0400, Christos Zoulas wrote:
>> How about this?
>> 
>> christos
>> 
>> Index: file.h
>> ===================================================================
>> RCS file: /p/file/cvsroot/file/src/file.h,v
>> retrieving revision 1.247
>> diff -u -p -u -r1.247 file.h
>> --- file.h      27 Jul 2023 19:40:22 -0000      1.247
>> +++ file.h      28 Jul 2023 14:37:17 -0000
>> @@ -159,9 +159,11 @@
>> /*
>>  * Dec 31, 23:59:59 9999
>>  * we need to make sure that we don't exceed 9999 because some libc
>> - * implementations like muslc crash otherwise
>> + * implementations like muslc crash otherwise. If you are unlucky
>> + * to be running on a system with a 32 bit time_t, then it is even less.
>>  */
>> -#define        MAX_CTIME       CAST(time_t, 0x3afff487cfULL)
>> +#define        MAX_CTIME \
>> +    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
>> 
>> #define FILE_BADSIZE CAST(size_t, ~0ul)
>> #define MAXDESC        64              /* max len of text description/MIME type */
> 
> Indeed that works also ... for glibc based systems or if autoconf 2.72c and
> newer I'd like to suggest the extended and attached patch as this enables
> wide time_t on 32bt platforms if available.
> 
> Werner
> 
> --
>  "Having a smoking section in a restaurant is like having
>          a peeing section in a swimming pool." -- Edward Burr
> <file-5_45-type_t_dif.DEFANGED-2>
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/file/attachments/20230731/d80ee0e2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20230731/d80ee0e2/attachment.asc>


More information about the File mailing list