diff options
author | sebres <sebres@users.sourceforge.net> | 2024-03-15 14:14:47 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2024-03-15 14:14:47 (GMT) |
commit | f146e011ed7d5ed1587f899434cd9711bdfdc143 (patch) | |
tree | 67c647f543ac69a49a31606c094f5c6796bd3f88 /generic/tclClockFmt.c | |
parent | 08efdeb20ae0c65ec01b3d0e32e0db6e3588fcf8 (diff) | |
download | tcl-f146e011ed7d5ed1587f899434cd9711bdfdc143.zip tcl-f146e011ed7d5ed1587f899434cd9711bdfdc143.tar.gz tcl-f146e011ed7d5ed1587f899434cd9711bdfdc143.tar.bz2 |
fixes [1f40aa83c552f597]: suppress integer-overflow trapping (atm, GCC "trapv" only) for intended pieces, avoid unexpected app-crash;
test cases (knownBug) reverted.
Diffstat (limited to 'generic/tclClockFmt.c')
-rw-r--r-- | generic/tclClockFmt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/generic/tclClockFmt.c b/generic/tclClockFmt.c index c216d34..66dbf6b 100644 --- a/generic/tclClockFmt.c +++ b/generic/tclClockFmt.c @@ -56,6 +56,11 @@ static void ClockFrmScnFinalize(void *clientData); *---------------------------------------------------------------------- */ +/* int overflows may happens here (expected case) */ +#if defined(__GNUC__) || defined(__GNUG__) +# pragma GCC optimize("no-trapv") +#endif + static inline int _str2int( int *out, @@ -113,6 +118,10 @@ _str2wideInt( *out = val; return TCL_OK; } + +#if defined(__GNUC__) || defined(__GNUG__) +# pragma GCC reset_options +#endif /* *---------------------------------------------------------------------- |