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

--- Comment #4 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 1 Oct 2020, slyfox at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97264
> 
> --- Comment #3 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
> Oh, that makes sense.
> 
> > void __vfscanf_internal__ (const char *f, __builtin_va_list argptr)
> > {
> >   /* assume input: "1<>\0" */
> >   while (*f != '\0')
> >     {
> >       const unsigned char ** pstr = (const unsigned char **) &f;
> 
> comes from
> https://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/vfscanf-internal.c;h=95b46dcbeb55b1724b396f02a940f3047259b926;hb=HEAD#l489
> :
> 
> """
>  274 int
>  275 __vfscanf_internal (FILE *s, const char *format, va_list argptr,
>  276                     unsigned int mode_flags)
> ...
>  487       if (ISDIGIT ((UCHAR_T) *f))
>  488         {
>  489           argpos = read_int ((const UCHAR_T **) &f);
> """

>From this little context it eventually makes sense to declare
'f' as const unsigned char * in this function.

Reply via email to