-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build warning - cast from pointer to integer of different size
object->values used to be a size in pass 1 and a pointer in pass 2. A union has been added to avoid such GCC warning: * cast from pointer to integer of different size * dereferencing type-punned pointer will break strict-aliasing rules The union is visible only when JSON__PRVATE_API is defined, but this trick relies on sizeof(json_object_entry *) >= sizeof(unsigned int). Is that acceptable? The name of the new union is "_p" (as in private) instead of "u", but it could be renamed back to "u", or even "_reserved" or "_r".
- Loading branch information
1 parent
60fd8a7
commit a04c7c6
Showing
2 changed files
with
39 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters