Conversation
The compiler cannot know the allocation is aligned to uint16_t and this avoids a cast alignment warning emitted by clang.
|
Regarding - table->metadata = (uint16_t *)( (unsigned char *)allocation + VT_CAT( NAME, _metadata_offset )( table ) );
+ table->metadata = (void *)( (unsigned char *)allocation + VT_CAT( NAME, _metadata_offset )( table ) );and - new_table.metadata = (uint16_t *)( (unsigned char *)allocation + VT_CAT( NAME, _metadata_offset )( &new_table ) );
+ new_table.metadata = (void *)( (unsigned char *)allocation + VT_CAT( NAME, _metadata_offset )( &new_table ) );was Clang-Tidy complaining about this cast for some reason? The And regarding - static const uint16_t vt_empty_placeholder_metadatum = VT_EMPTY;
+ static uint16_t vt_empty_placeholder_metadatum = VT_EMPTY;is this because Clang-Tidy complains about the (deliberate) casting-away of |
No, this was clang itself compiling it. I think clang17, or whatever is in Alpine Linux 3.20.0.
Actually it was gcc complaining about it. So both compiler errors. I'm on holiday for a week and don't have access to my sources right now, but from memory these are my CFLAGS. I think I included -pedantic and -std=c23 as well, but can't be sure. |
If the
Oh, I see. The issue here is the use of |
Fixes #6.