xfsdump doesn't compile: undefined reference to 'min'
Quoted 7 lines
commit
5a2985233c390d59d2a9757b119cb0e001c87a96Author: Dave Chinner <[email protected]> Date: Fri Jul 18 08:02:26 2014 +1000dump: don't redefine
min()ormax()They are included from other header files.
The message doesn't say from which header and configure doesn't test for it.
If I compile it (cross-compilation, gcc, uclibc, xfsprogs 3.1.11, xfsdump 3.1.4), I get lots of errors:
warning: implicit declaration of function 'max'
undefined reference to 'min'
Attached is a pragmatic patch.
Detlef
PS: I'm not on the list.
common/util.h +6 -0
@@ -66,6 +66,12 @@ extern intgen_t read_buf( char *bufp,rrbfp_t return_read_buf_funcp, intgen_t *statp ); +#ifndef min +#define min ( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) +#endif +#ifndef max +#define max ( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) +#endif /* strncpyterm - like strncpy, but guarantees the destination is null-terminated
restore/dirattr.c +4 -0
@@ -51,6 +51,10 @@/* structure definitions used locally ****************************************/ +#ifndef max +#define max ( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) +#endif +/* node handle limits */ #ifdef DIRATTRCHK
restore/namreg.c +4 -0
@@ -34,6 +34,10 @@/* structure definitions used locally ****************************************/ +#ifndef max +#define max ( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) +#endif +#define NAMREG_AVGLEN 10/* persistent context for a namreg - placed in first page
restore/node.c +7 -0
@@ -30,6 +30,13 @@#include "node.h" #include "mmap.h" +#ifndef max +#define max ( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) +#endif +#ifndef min +#define min ( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) +#endif +extern size_t pgsz;extern size_t pgmask;
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 6 lines · Detlef Vollmann
Quoted 6 lines
commit
5a2985233c390d59d2a9757b119cb0e001c87a96Author: Dave Chinner <[email protected]> Date: Fri Jul 18 08:02:26 2014 +1000dump: don't redefine
min()ormax()
Quoted 7 lines
Quoted 1 line
They are included from other header files.
The message doesn't say from which header and configure doesn't test for it.
If I compile it (cross-compilation, gcc, uclibc, xfsprogs 3.1.11, xfsdump 3.1.4), I get lots of errors:
warning: implicit declaration of function 'max'
undefined reference to 'min'
#include <xfs/xfs.h>
-> /usr/include/xfs/xfs.h
#include <xfs/platform_defs.h>
-> /usr/include/xfs/platform_defs.h
#define min(a,b) (((a)<(b))?(a):(b))These headers come from xfsprogs, and you'll need to upgrade that package to 3.2.x....
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 8 lines · Dave Chinner
Quoted 6 lines · Detlef Vollmann
The message doesn't say from which header and configure doesn't test for it.
If I compile it (cross-compilation, gcc, uclibc, xfsprogs 3.1.11, xfsdump 3.1.4), I get lots of errors:
warning: implicit declaration of function 'max'
undefined reference to 'min'
Quoted 8 lines
#include <xfs/xfs.h> -> /usr/include/xfs/xfs.h #include <xfs/platform_defs.h> -> /usr/include/xfs/platform_defs.h #define min(a,b) (((a)<(b))?(a):(b))These headers come from xfsprogs, and you'll need to upgrade that package to 3.2.x....
Thank.
Unfortunately that doesn't seem to be an option, so sticking with xfsdump-3.1.3.
Detlef
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs