chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] [Chicken-bugs] #348: Chicken should use proper C type


From: Chicken Scheme
Subject: [Chicken-janitors] [Chicken-bugs] #348: Chicken should use proper C types for struct stat members
Date: Thu, 01 Nov 2007 08:12:20 -0000

#348: Chicken should use proper C types for struct stat members
--------------------+-------------------------------------------------------
Reporter:  sjamaan  |       Owner:  felix                     
    Type:  defect   |      Status:  new                       
Priority:  major    |   Component:  core libraries            
 Version:  2.7      |    Keywords:  typing, C interface, posix
--------------------+-------------------------------------------------------
 See the thread "[http://lists.gnu.org/archive/html/chicken-hackers/2007-
 10/msg00017.html file-size not reporting correct size on big files]" on
 chicken-hackers.

 The problem is that chicken uses {{{unsigned-int}}} as the type of
 {{{stat}}} structure members (and probably in other places, too!), which
 causes problems on 32-bit architectures.  The {{{stat.st_size}}} is of
 type {{{off_t}}}, which ''can'' be 64-bit on some systems, if compiled the
 right way.  When using an {{{unsigned-int}}}, huge file sizes (bigger than
 1Gb) overflow/get truncated.  Simply using an int64 is not the solution
 either, as you don't know what size {{{off_t}}} is actually.  If it ''is''
 32-bits you would be getting file sizes that are corrupted even more.

-- 
Ticket URL: <http://trac.callcc.org/ticket/348>
Chicken Scheme <http://www.call-with-current-continuation.org/>
The CHICKEN Scheme-to-C compiler

reply via email to

[Prev in Thread] Current Thread [Next in Thread]