I believe that this attached patch gets intprops.h TYPE_MAXIMUM to
handle unsigned types.
A mask is needed because of an extension that most C compilers have that
allow ((unsigned int) -1) to be tested as being less than 0 through
operand promotion.
This still leaves me a problem with getdate.y which asserts a compiler
error if I set the time_t type to be an unsigned long.
If I set the time_t type to be a signed long, it causes problems as the
definition of struct timespec in the VMS headers is unsigned long
instead of time_t. This is not detected at compile time, but at run
time as it cause no files to be selected for the archive.
As a work around, I can compile getdate.c with time_t set to being a
signed type, and the rest of tar with it being unsigned. That gets the
first test to work, but I do not know what the other impacts of this are.
-John
[EMAIL PROTECTED]
Personal Opinion Only
--- lib/intprops.h_hide Fri Sep 28 08:11:36 2007
+++ lib/intprops.h Sun Dec 16 19:13:54 2007
@@ -50,7 +50,7 @@
: ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
#define TYPE_MAXIMUM(t) \
((t) (! TYPE_SIGNED (t) \
- ? (t) -1 \
+ ? ((t) -1) & LONG_MAX \
: ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
/* Return zero if T can be determined to be an unsigned type.