Skip to content

Commit

Permalink
Type cast truncation warning fix;
Browse files Browse the repository at this point in the history
Remove references to deleted test.
  • Loading branch information
rocso committed Aug 26, 2021
1 parent aa2044b commit fd3a595
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
9 changes: 9 additions & 0 deletions tests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2021-08-26 Ross Johnson <ross dot johnson at homemail dot com dot au>

* runorder.mk (threestage): remove reference to this test; VC nmake doesn't
appear to notice it's referenced, which is disturbing, but GNU make does.
* common.mk (threestage): Likewise.
* exit2.c: Fix type cast truncation by changing (void * -> int) to
(void * -> size_t).
* exit3.c: Likewise.

2018-08-19 Ross Johnson <ross dot johnson at homemail dot com dot au>

* threestage.c: Delete.
Expand Down
2 changes: 1 addition & 1 deletion tests/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ALL_KNOWN_TESTS = \
sequence1 \
sizes \
spin1 spin2 spin3 spin4 \
stress1 threestage \
stress1 \
tsd1 tsd2 tsd3 \
valid1 valid2

Expand Down
4 changes: 2 additions & 2 deletions tests/exit2.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
void *
func(void * arg)
{
int failed = (int) arg;
size_t failed = (size_t) arg;

pthread_exit(arg);

/* Never reached. */
/*
* Trick gcc compiler into not issuing a warning here
*/
assert(failed - (int)arg);
assert(failed - (size_t) arg);

return NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/exit3.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
void *
func(void * arg)
{
int failed = (int) arg;
size_t failed = (size_t) arg;

pthread_exit(arg);

/* Never reached. */
/*
* assert(0) in a way to prevent warning or optimising away.
*/
assert(failed - (int) arg);
assert(failed - (size_t) arg);

return NULL;
}
Expand Down
1 change: 0 additions & 1 deletion tests/runorder.mk
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ spin2.pass: spin1.pass
spin3.pass: spin2.pass
spin4.pass: spin3.pass
stress1.pass: create3.pass mutex8.pass barrier6.pass
threestage.pass: stress1.pass
timeouts.pass: condvar9.pass
tsd1.pass: barrier5.pass join1.pass
tsd2.pass: tsd1.pass
Expand Down

0 comments on commit fd3a595

Please sign in to comment.