Variadic macros in installed headers
Martin Sebor
msebor@gmail.com
Wed Dec 18 20:01:00 GMT 2019
Florian,
I attached a more complete version of the patch to the Glibc bug
in case you or someone else has cycles to finish it up in time to
make the upcoming release. I won't be around until Jan. 6 and
I'm not sure if that's not too late.
Martin
On 11/25/19 1:02 PM, Florian Weimer wrote:
> * Martin Sebor:
>
>>> We probably should have two variants for __write_only__, one that says
>>> âwill writeâ, and one for âmay writeâ.
>>
>> You mean a "full write" to guarantee that exactly as many elements
>> will have been written (as in memset) and "may write" to denote
>> a partial write (like strcpy or fgets)? Those extensions certainly
>> are possible within the attribute framework.
>
> Exactly.
>
>> PS I'm excited about this feature because besides out-of-bounds
>> accesses, the attribute makes it possible (and I have patches)
>> to detect uninitialized reads by annotated functions
>> (-Wuninitialized), variables that are written to but not read
>> from (-Wunused), and overlapping copies (-Wrestrict).
>
> And the uninitialized-variable information will benefit from
> information that shows that something has definitely been written to.
>
>> In addition, the attribute also opens up similar optimization
>> opportunities for user-defined functions as those compilers
>> already take advantage of for built-in functions.
>
> It may also allow us to remove some interceptors from the sanitizer
> libraries.
>
More information about the Libc-alpha
mailing list