bug-ddrescue
[Top][All Lists]
Advanced

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

Re: [Bug-ddrescue] (no subject)


From: Ariel
Subject: Re: [Bug-ddrescue] (no subject)
Date: Wed, 17 Aug 2005 10:41:45 -0400 (EDT)


On Tue, 16 Aug 2005, Walton A. Green wrote:


Tried to compile ddrescue 1.0 and 1.0.1 on a Mac 10.2.3 with gcc 3.1 and
got the following errors (output from 1.0)...I know this is an old system,
but I don't have immediate access to a more up-to-date installation. Is
there a reasonably quick fix, or should I find a newer computer?

You would need newer C++ libraries, not a newer compiler. (They may come together though.)

ddrescue.cc:185: `llabs' undeclared in namespace `std'
ddrescue.cc:187: `snprintf' undeclared in namespace `std'

Option 1:

Both of those are in the format_num function which is not critical. Just have it output the raw number, not the pretty format - it will mess up the output formating, but it will work.

Change:
  for( int i = 0; i < 8 && std::llabs( num ) > std::llabs( max ); ++i )
    { num /= factor; p = prefix[i]; }
  std::snprintf( buf, sizeof( buf ), "%lld %s", num, p );
  return buf;

To:
 std::sprintf( buf, "%lld", num);

And change (in the same function):
  static char buf[16];

To:
  static char buf[21];

PS. This is not a tested change, but if it compiles and look OK when run, it should be fine.

Option 2:

Change std::llabs to just llabs, and try a recompile. If the llabs error then goes away, change the size of buf to 25, as above, and rename snprintf to sprintf. If the llabs error doesn't go away, go with option 1.

        -Ariel




reply via email to

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