Convert all checks for whether pData_ points to emptyString_ to checks for zero capacity(). This is a safer check, which should work across shared library boundaries.
Removes AllocatorStringStorage::Realloc. This function was not used and potentially incorrect, as it would call Free on the input buffer, even if it was emptyString_.
I did not use #pragma to silence the warnings because it seems gcc 11.2 doesn't support disabling this warning (the warnings are still emitted).
This PR makes 3 commits:
pData_
points toemptyString_
to checks for zerocapacity()
. This is a safer check, which should work across shared library boundaries.pData_
never points toemptyString_
whencapacity()
is zero. This fixes https://github.com/boostorg/wave/issues/159.AllocatorStringStorage::Realloc
. This function was not used and potentially incorrect, as it would callFree
on the input buffer, even if it wasemptyString_
.I did not use
#pragma
to silence the warnings because it seems gcc 11.2 doesn't support disabling this warning (the warnings are still emitted).