It's useless to declare the str arg as const when all the function does is assign it to a non-const pointer.
I found one caller that wants to pass a const pointer, ranap_msg_factory.c:184. Fixing that in a commit to osmo-iuh. All other callers pass non-const str arguments anyway. --- include/asn1c/asn1helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/asn1c/asn1helpers.h b/include/asn1c/asn1helpers.h index d6b5e18..90e78ae 100644 --- a/include/asn1c/asn1helpers.h +++ b/include/asn1c/asn1helpers.h @@ -21,7 +21,7 @@ uint32_t asn1bitstr_to_u32(const BIT_STRING_t *in); uint32_t asn1bitstr_to_u28(const BIT_STRING_t *in); uint32_t asn1bitstr_to_u24(const BIT_STRING_t *in);
-static inline void OCTET_STRING_noalloc(OCTET_STRING_t *s, const uint8_t *str, int size) +static inline void OCTET_STRING_noalloc(OCTET_STRING_t *s, uint8_t *str, int size) { s->buf = str; s->size = size;