https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118004

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xry111 at gcc dot gnu.org

--- Comment #3 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #2)
> __attribute__ ((access (read_only, 2)))
>  int printf(const char *format, const char *x);
> 
> // Type your code here, or load an example.
> void f2() {
>   char not_secret[7];
>    printf("f2 %s\n", not_secret);
> }
> 
> The above gives the correct warning, so what is needed is a way to apply the
> attribute "access" to "...", which will allow applying it to
> __builtin_printf__(). 
> 
> That would be more useful than special casing __builtin_printf__ in the
> Wuninitialized code.

Making the entire ... access (read_only) would be incorrect, considering the
argument corresponding to %n should be access (write_only) instead.

So we still need to special case __builtin_printf.

Reply via email to