Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14189 closed defect (fixed)

Silence implicit uint64_t to size_t conversion warnings in clang on 32-bit OS X

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: 0.2.6.x-final
Component: Core Tor/Tor Version: Tor:
Severity: Keywords: clang
Cc: nickm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


The out of memory checking code performs a calculation based on the difference between the memory used (a size_t) and the memory limit (a uint64_t).

This causes warnings in clang about implicit conversions losing precision. To ensure this isn't happening, I assert MaxMemInQueues <= SIZE_T_MAX before casting.

Branch will be posted after I have the bug number.

Child Tickets

Change History (3)

comment:1 Changed 6 years ago by teor

Status: newneeds_review

This issue was introduced in 3033ba9f5ec8 on 5 January 2015, after was released.

Do I need a changes file for it? Feel free to drop the one I've included if it's superfluous.

Branch: bug14189-silence-clang-implicit-conversion
In my git repository.

comment:2 Changed 6 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Changes files aren't needed for bugs that never went into a release.

But I think I already did a patch for this one last night while I wasn't checking email: does 732c885b32477513b6ef374620dec32c54eb2d9c fix this for you? Please reopen if not.

comment:3 Changed 6 years ago by teor

This works, and my patch included some unnecessary paranoia.

Note: See TracTickets for help on using tickets.