Re: [Hampshire] scanf conversion - anyone know what '%m' is?

Top Page

Reply to this message
Author: Bob Dunlop
Date:  
To: hampshire
Subject: Re: [Hampshire] scanf conversion - anyone know what '%m' is?

On Wed, Jul 23 at 11:22, Vic wrote:
> >
> > As a note for the future it would be really useful if you could provide
> > more information with this sort of query.
>
> Really? I thought that would just be extraneous here; I'm not filing a bug
> report with HantsLUG, I filed it with RH...


So it was just a gripe directed at HantsLUG that you weren't expecting any
feedback on ?


Anyway I've found a useful email[1] that explains it.

Basically the %m (malloc) modifier is a replacement for sscanfs %a (alloc)
which is being introduced to avoid the clash of %a with another ISO C99
usage.

In any case the frysk code is wrong.

Frysk original:
    switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))


Correct using older gcc/glibc:
    switch (sscanf (a.arg, "%as[^:]:%d", &a.file, &a.line))


Correct using bleeding edge gcc/glibc:
    switch (sscanf (a.arg, "%ms[^:]:%d", &a.file, &a.line))



Either way I think your complaint should be directed at the frysk
developers rather than RH.


[1] http://gcc.gnu.org/ml/gcc-patches/2007-09/msg01342.html


-- 
        Bob Dunlop