Remove 'long' overloads for Xdr::read and Xdr::write functions #952
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changing Int64 to uint64_t caused a build failure on some macOS targets.
Apparently on macOS,
uint64_t
is along long unsigned int
, rather than along unsigned int
, but theuint64_t
overloads were #ifdef'd out, since ULONG_MAX is still 2^64-1. Providing Xdr::read and Xdr::write types for 'long' seems dangerous, due to such inconsistencies. One architecture/compiler may treat a type as along
and write 8 bytes, another may treat it is anint
and read only 4 bytes, causing an incorrect stream pointer. It seems safer to remove all references tolong
from Xdr::read and Xdr::write, and simply provideuint64_t
andint64_t
overloads to read and write. Only types with well defined sizes should be read to or written from streams.The only references to
long
values being used with Xdr were in IDManifest, which was a bug of exactly this nature, and in testXdr