Opened 4 years ago

Closed 4 years ago

#11825 closed defect (fixed)

Casts in tinytest macros suppress useful warnings

Reported by: nickm Owned by:
Priority: Medium Milestone: Tor: 0.2.5.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client testing
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


In the tinytest tt_assert_test_fmt_type macro, we do:

	type val1_ = (type) (a);						\
	type val2_ = (type) (b);						\

Those two typecasts are dangerous, since they suppress every signed/unsigned warning, narrowing warning, or whatever that would create a problem in our unit tests. We should take them out and clean up the mess.

Putting this in 0.2.5.x since working unit tests will help us find other bugs, maybe.

Child Tickets

Change History (4)

comment:1 Changed 4 years ago by nickm

Fixed in 5bb617236704be189e68c713d95dac002912a219. I suspect, though, that this will turn up some 32-bit issues.

comment:2 Changed 4 years ago by nickm

Okay, I think I fixed the 32-bit issues this turned up. Leaving this open till jenkins tells me that the tests pass. :)

comment:3 Changed 4 years ago by nickm

Component: - Select a componentTor

comment:4 Changed 4 years ago by nickm

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.