[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-ddrescue] ddrescue-0.9: build comments
From: |
Nelson H. F. Beebe |
Subject: |
[Bug-ddrescue] ddrescue-0.9: build comments |
Date: |
Sat, 8 Jan 2005 10:55:51 -0700 (MST) |
I ran build attempts for ddrescue-0.9 this morning in 24 compilation
environment on about 20 flavors of Unix.
While ddrescue built on several GNU/Linux platforms, builds failed
everywhere else. I have therefore chosen not to install it anywhere
until a version appears that builds successfully (almost) everywhere.
One problem that needs repair is that the Makefile has g++ hardcoded.
GNU autoconf conventions are that CC, CXX, CFLAGS, CXXFLAGS, LIBS, and
LDFLAGS should all be settable in the environment, and propagate into
the Makefile. While gcc builds on many platforms, there are still
some where it is problematic, and in computer software, and biology,
monoculture is always a very bad idea for survival. Robustness and
portability are only achievable when software is built, tested, and
installed in the widest variety of environments.
Compilers reported these problems; they are typical of reports on many
systems, so I'm showing only this subset.
g++ -Wall -W -O2 -c -o ddrescue.o ddrescue.cc
ddrescue.cc: In member function `bool Block::join(const Block&)':
ddrescue.cc:94: warning: comparison between signed and unsigned integer
expressions
ddrescue.cc:94: warning: comparison between signed and unsigned integer
expressions
ddrescue.cc:96: warning: comparison between signed and unsigned integer
expressions
ddrescue.cc:96: warning: comparison between signed and unsigned integer
expressions
ddrescue.cc: In function `void show_status(long int, long int, long
int, long
int, long unsigned int, const char*, bool)':
ddrescue.cc:260: warning: unsigned int format, different type arg (arg
3)
ddrescue.cc: In function `int main(int, char**)':
ddrescue.cc:793: warning: int format, different type arg (arg 2)
ddrescue.cc:797: warning: int format, different type arg (arg 2)
ddrescue.cc:800: warning: int format, different type arg (arg 2)
ddrescue.cc:801: warning: int format, different type arg (arg 2)
The format mismatches are potential sources of core dumps; suitable
typecasts can eliminate the others.
g++ -Wall -W -O2 -c -o ddrescue.o ddrescue.cc
ddrescue.cc:34: getopt.h: No such file or directory
getopt is NOT a standard C utility; if you use it, you MUST provide
your own code. There are numerous sources of getopt.[ch] in other GNU
packages.
g++ -Wall -W -O2 -c -o ddrescue.o ddrescue.cc
ddrescue.cc: In function `long long int getnum(const char*, size_t,
long long int, long long int)':
ddrescue.cc:160: error: `strtoll' is not a member of `std'
ddrescue.cc:193: error: `llabs' is not a member of `std'
ddrescue.cc: In function `bool check_identical(const char*, const
char*)':
ddrescue.cc:207: error: aggregate `stat stat1' has incomplete type and
cannot be defined
ddrescue.cc:207: error: aggregate `stat stat2' has incomplete type and
cannot be defined
ddrescue.cc:208: error: invalid use of undefined type `struct stat'
ddrescue.cc:207: error: forward declaration of `struct stat'
ddrescue.cc:208: error: invalid use of undefined type `struct stat'
ddrescue.cc:207: error: forward declaration of `struct stat'
ddrescue.cc: In function `const char* format_num(long long int, long
long int, int)':
ddrescue.cc:229: error: `llabs' is not a member of `std'
ddrescue.cc:229: error: `llabs' is not a member of `std'
ddrescue.cc:231: error: `snprintf' is not a member of `std'
ddrescue.cc: In function `int copyfile(Control&, off_t&, off_t&,
size_t, size_t, int, int, int, int,
int, bool)':
ddrescue.cc:542: error: `snprintf' is not a member of `std'
ddrescue.cc: In function `bool read_logfile(const char*, Control&,
off_t&, int, size_t)':
ddrescue.cc:566: error: `snprintf' is not a member of `std'
ddrescue.cc:589: error: `snprintf' is not a member of `std'
ddrescue.cc: In function `int write_logfile(const char*, Control&)':
ddrescue.cc:625: error: `snprintf' is not a member of `std'
ddrescue.cc:635: error: `snprintf' is not a member of `std'
ddrescue.cc:654: error: `snprintf' is not a member of `std'
ddrescue.cc: In function `int main(int, char**)':
ddrescue.cc:702: error: `no_argument' undeclared (first use this
function)
ddrescue.cc:702: error: (Each undeclared identifier is reported only
once for each function it appears
in.)
ddrescue.cc:703: error: `required_argument' undeclared (first use this
function)
ddrescue.cc:717: error: elements of array `const option long_options[]'
have incomplete type
ddrescue.cc:717: error: uninitialized const `long_options'
ddrescue.cc:717: error: storage size of `long_options' isn't known
ddrescue.cc:719: error: `getopt_long' undeclared (first use this
function)
ddrescue.cc:700: error: storage size of `long_options' isn't known
These failures reflect a namespace problem. Few C++ compilers are at
the level of the 1998 ISO C++ Standard (never mind that there is now a
2003 ISO C++ Standard, sigh...), so suitable configure tests need to
be made to figure out what needs to be done in older C++ environments.
ddrescue looks like a very nice addition to the Unix toolbox, one for
which there doesn't appear to be a preexisting tool that can do the
job. I look forward to having it installed everywhere from a future
release.
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- University of Utah FAX: +1 801 581 4148 -
- Department of Mathematics, 110 LCB Internet e-mail: address@hidden -
- 155 S 1400 E RM 233 address@hidden address@hidden -
- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe -
-------------------------------------------------------------------------------
- [Bug-ddrescue] ddrescue-0.9: build comments,
Nelson H. F. Beebe <=