Re: Ada.Directories.Size wraps on over 2Gb files



On Dec 10, 8:29 pm, "Randy Brukardt" <ra...@xxxxxxxxxxxxxx> wrote:
<gp...@xxxxxxxxx> wrote in message

news:0db40dde-17f0-40a9-9dc0-55f9b0a8e1b1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Ada.Directories.Size wraps on over 2Gb files returning negative
number. I saw that was mentioned in

Sounds like a compiler bug. Ada.Directories.Size is supposed to return the
correct answer or Constraint_Error. Constraint_Error only if the type
File_Size can't hold the value (for instance, if it is 32-bits on a compiler
that only supports 32-bit integers). You didn't say what compiler that you
are using, but you should contact your vendor.

BTW, it isn't possible for Ada.Directories.Size to return a negative number
unless something is *really* screwed up, because type
Ada.Directories.File_Size does not include negative numbers. They'd have to
have suppressed range checking of the result...

Randy.

I am using:

GPS 4.1.3 (20070913) hosted on pentium-mingw32msv
GNAT GPL 2007 (20070405-41)

with following:

type File_Size is range 0 .. Long_Long_Integer'Last;
-- The type File_Size represents the size of an external file

Range checks might been suppressed in the library.
.



Relevant Pages

  • Re: Ada.Directories.Size wraps on over 2Gb files
    ... Sounds like a compiler bug. ... BTW, it isn't possible for Ada.Directories.Size to return a negative number ... have suppressed range checking of the result... ...
    (comp.lang.ada)
  • Re: pointer components and memory leaks
    ... that's the same thing as what Paul said. ... Let's not suggest compiler bug every time one finds a problem. ... leak memory, though even there, user bugs in other parts of the code can ...
    (comp.lang.fortran)
  • Re: Really wierd bug
    ... > it has to be a compiler bug because it works fine for other population ... > My compiler is Compaq Visual Fortran 1997-1999. ... > with allocating the array sizes because I've defined the arrays as ... your program does indeed contain an array bounds error -- this ...
    (comp.lang.fortran)
  • Re: Questions in Optimization !!
    ... that the problem is absolutely, positively not a compiler bug, because ... "But it works as long as I don't use optimization! ... resulting in stack corruption ...
    (comp.os.vxworks)
  • Re: pointer components and memory leaks
    ... that's the same thing as what Paul said. ... Let's not suggest compiler bug every time one finds a problem. ... leak memory, though even there, user bugs in other parts of the code can ...
    (comp.lang.fortran)