Skip to content

Commit

Permalink
Used local pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ndp-opendap committed Sep 3, 2024
1 parent 9b9119f commit a1d2ab2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/TestInt32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,14 @@ bool TestInt32::read() {
// jhrg 3/12/14
// d_buf = d_buf * 32;
//
//d_buf <<= 5;
//if (!d_buf)
// d_buf <<= 5;
// if (!d_buf)
// d_buf = 32;
// The above version caused runtime errors on OSX 14.6.1:
// The above version caused runtime errors on OSX 14.6.1:
//
//. +TestInt32.cc:88:15: runtime error: left shift of 1073741824 by 5 places cannot be represented in type 'dods_int32' (aka 'int')
// +SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior TestInt32.cc:88:15 in
//. +TestInt32.cc:88:15: runtime error: left shift of 1073741824 by 5 places cannot be represented in type
//'dods_int32' (aka 'int')
// +SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior TestInt32.cc:88:15 in
//
// Replaced with a slower but cautious version below - ndp 09/3/2024
long long val = d_buf;
Expand All @@ -103,7 +104,7 @@ bool TestInt32::read() {
d_buf = 0xFFFFFFFF & val;
}
DBGN(cerr << __PRETTY_FUNCTION__ << "d_buf: " << d_buf << endl);

} else {
d_buf = 123456789;
}
Expand Down

0 comments on commit a1d2ab2

Please sign in to comment.