[PATCH v8 03/19] Object Attributes v2: new abstractions for subsections and attributes
Jan Beulich
jbeulich@suse.com
Mon Aug 4 15:45:56 GMT 2025
On 04.08.2025 17:25, Matthieu Longo wrote:
> On 2025-07-31 13:18, Jan Beulich wrote:
>> On 15.07.2025 13:39, Matthieu Longo wrote:
>>> +typedef struct obj_attr_subsection_v2 {
>>> + /* The name of the subsection. */
>>> + const char *name;
>>> +
>>> + /* The scope of the subsection. */
>>> + obj_attr_subsection_scope_v2 scope;
>>> +
>>> + /* Is this subsection optional ? Can it be skipped ? */
>>
>> Like full stops, question marks don't really want/need separating by a
>> blank.
>>
>
> Fixed.
>
>>> + bool optional;
>>> +
>>> + /* The value encoding of attributes in this subsection. */
>>> + obj_attr_encoding_v2 encoding;
>>> +
>>> + /* The size of the list. */
>>> + uint32_t size;
>>
>> Here and elsewhere I think it would be better to use "unsigned int".
>> Fixed-width types are helpful to describe ABIs or file formats.
>
> What about using size_t instead ?
> The only issue I see with size_t is that it is platform dependent so the
> size can change. But is it an issue here ?
I wouldn't mind size_t here, albeit I neither think it's accurate (you
describe a count, not a size of anything), nor would I be happy with the
extra space need on 64-bit architectures. Hence why I suggested unsigned
int.
Jan
More information about the Binutils
mailing list