pnoltes commented on PR #727:
URL: https://github.com/apache/celix/pull/727#issuecomment-1937829380

   > Concerning the asserts, my preference is to remove them in the 
`celix_arrayList_get*` functions, but keep them in the `celix_arrayList_add*` 
functions. I prefer not use the `CELIX_ILLEGAL_ARGUMENT` return value, because 
we are then adding the need for runtime error checks on software errors. IMO 
Ideally the only error return for celix array list functions is ENOMEM.
   
   Another option could be to keep the "undefined element type" array list 
as-is and introduce specific element typed array lists, e.g.: 
`celix_long_array_list_t`, `celix_string_array_list_t`, etc. The current array 
list implementation can be reused (with the element type enum private). This 
would ensure strong typing and prevent wrong usage of array lists. 
   
   Note a simple typedef (e.g. `typedef struct celix_array_list 
celix_long_array_list_t;`) is not enough and something extra needs to be added 
to ensure that typed array list are not interchangeable. 
   


-- 
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