diff options
author | das <das@noemail.net> | 2005-12-15 04:08:26 (GMT) |
---|---|---|
committer | das <das@noemail.net> | 2005-12-15 04:08:26 (GMT) |
commit | a6e3ecfea035ca9d807f34bfe62b0633054f7bc9 (patch) | |
tree | 72c167d3c6e9a20e08a71bdbc50e57d9a128d2aa /generic/tclTest.c | |
parent | 4605070c8700a7033ef760d13b82e1f505a3c5bb (diff) | |
download | tcl-a6e3ecfea035ca9d807f34bfe62b0633054f7bc9.zip tcl-a6e3ecfea035ca9d807f34bfe62b0633054f7bc9.tar.gz tcl-a6e3ecfea035ca9d807f34bfe62b0633054f7bc9.tar.bz2 |
* generic/tclIOUtil.c: workaround gcc warning "comparison is always
* generic/tclTest.c: false due to limited range of data type".
FossilOrigin-Name: d3f02d4f628fee2d6a881ed9446f0342c8f73386
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r-- | generic/tclTest.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index e02ba13..59c3148 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTest.c,v 1.62.2.10 2005/10/23 22:01:30 msofer Exp $ + * RCS: @(#) $Id: tclTest.c,v 1.62.2.11 2005/12/15 04:08:26 das Exp $ */ #define TCL_TEST @@ -4715,8 +4715,19 @@ static int PretendTclpStat(path, buf) # define OUT_OF_RANGE(x) \ (((Tcl_WideInt)(x)) < Tcl_LongAsWide(LONG_MIN) || \ ((Tcl_WideInt)(x)) > Tcl_LongAsWide(LONG_MAX)) +#if defined(__GNUC__) && __GNUC__ >= 2 +/* + * Workaround gcc warning of "comparison is always false due to limited range of + * data type" in this macro by checking max type size, and when necessary ANDing + * with the complement of ULONG_MAX instead of the comparison: + */ +# define OUT_OF_URANGE(x) \ + ((((Tcl_WideUInt)(~ (__typeof__(x)) 0)) > (Tcl_WideUInt)ULONG_MAX) && \ + (((Tcl_WideUInt)(x)) & ~(Tcl_WideUInt)ULONG_MAX)) +#else # define OUT_OF_URANGE(x) \ (((Tcl_WideUInt)(x)) > (Tcl_WideUInt)ULONG_MAX) +#endif /* * Perform the result-buffer overflow check manually. |