Fix[bmqa_message.h]: Enable message d_groupId
field regardless of build
#433
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.
Issue number of the reported bug or feature request: #426
Describe your changes
We currently do some cleverness with where and when we enable the incomplete message group ID feature in
CMakeLists.txt
. However, when using thebuild-darwin.sh
andbuild-ubuntu.sh
scripts, as we currently recommend, the libraries we install usingmake install
have this feature enabled.Unfortunately, enabling message group IDs changes the size of
bmqa_message
’sMessageImpl
, so a library built with message group IDs enabled is ABI-incompatible with an application built with message group IDs disabled. Because we don’t advertise this feature anywhere or export the definition from CMake, users are unlikely to know they need to compile with the flag-DBMQ_ENABLE_MSG_GROUPID
, and will run into characteristic ABI-incompatibility issues: buffer overruns, stack clobbering, and segmentation faults.This patch makes a minimal change until we decide what to do with message group IDs: the API is still sensitive to
BMQ_ENABLE_MSG_GROUPID
, but the message structure itself always carries ad_groupId
field, regardless of its presence. This field is default-initialized and is otherwise unused.Testing performed
This change fixes the minimal example given in #426. I will let the CI run all the tests to ensure no breakage.