PengZheng commented on code in PR #446:
URL: https://github.com/apache/celix/pull/446#discussion_r1051309169


##########
libs/utils/src/properties.c:
##########
@@ -467,11 +469,42 @@ int celix_properties_size(const celix_properties_t 
*properties) {
 }
 
 celix_properties_iterator_t celix_propertiesIterator_construct(const 
celix_properties_t *properties) {
-    return hashMapIterator_construct((hash_map_t*)properties);
+    celix_properties_iterator_t iter;

Review Comment:
   ```suggestion
       celix_properties_iterator_t iter;
       CELIX_BUILD_ASSERT(sizeof(celix_properties_iterator_t) == 
sizeof(hash_map_iterator_t));
       CELIX_BUILD_ASSERT(__alignof__(celix_properties_iterator_t) == 
__alignof__(hash_map_iterator_t));
   ```
   
   I'm OK with the current explicit way, but strongly recommend adding 
build-time assertions in case of any future inconsistency. Without those 
assertions, it's way too easy to introduce subtle bugs silently when 
`hash_map_iterator_t` is modified.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to