[PATCH] dirent.h: use __flexarr instead of hardcoding [1] length

Carlos O'Donell carlos@redhat.com
Mon Feb 24 14:38:25 GMT 2025


On 2/13/25 4:52 PM, Cristian Rodríguez wrote:
> On Thu, Feb 13, 2025 at 4:42 PM Etienne Brateau 
> <etienne.brateau@gmail.com> wrote:
>> Doing a `sizeof(dirent->d_name)` seems to be a widely used
>> technique (https://codesearch.debian.net/search?
>> q=sizeof%5B%5E%28%5D*%5C%28%5B%5E%29%5D*%5Cbd_name&literal=0)
>> 
> 
> Yes, it is a widespread nonstandard misuse. The relevant standards
> say d_name is of unknown size.
> 

We reviewed this in the weekly patch queue review.

I've marked this patch as rejected in patchwork for now since we don't have a
strong reason to break backwards source level compatibility with existing uses.

-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list