From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30912 invoked by alias); 29 Oct 2012 15:56:44 -0000 Received: (qmail 30705 invoked by uid 48); 29 Oct 2012 15:56:18 -0000 From: "simon at pushface dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/55119] New: Ada.Directories only handles files under 2GB Date: Mon, 29 Oct 2012 15:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon at pushface dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg02713.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55119 Bug #: 55119 Summary: Ada.Directories only handles files under 2GB Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada AssignedTo: unassigned@gcc.gnu.org ReportedBy: simon@pushface.org In adaint.c, __gnat_stat_to_attr says /* st_size may be 32 bits, or 64 bits which is converted to long. We don't return a useful value for files larger than 2 gigabytes in either case. */ attr->file_length = statbuf.st_size; /* all systems */ where attr->file_length is a long. This fails with large files on 64-bit filesystems (eg, Mac OS X). I _think_ that a simple fix would be, in adaint.h, to define file_attributes.file_length as a long long.