Undefined behaviour causing problems on AVR32
Bradley Smith
bradsmith at debian.org
Mon Apr 13 16:07:29 CEST 2009
On Mon, 13 Apr 2009 14:02:20 +0200
Torbjorn Granlund <tg at gmplib.org> wrote:
> I agree this is broken in GMP.
>
> I don't fully understand the GMP scanf code.
>
> I find two calls to sscanffuns.c's scan through the ->scan field, both
> from __gmp_doscan. One call uses 3 parameters and the other uses 4
> parameters.
>
> Both the current and your suggested code assumes there are 4 parameters.
> While your code is an improvement, it still looks undefined to me.
>
> Do you agree?
Hmm, yes I didn't spot the call that uses 3 args, I guess a simple way to
fix that would be to change the call that uses 3 args to use 4, by just
putting a dummy argument as the 4th. Maybe not the nicest fix, but I can't
really see an alternative that doesn't involve rewriting large chunks of
the code.
Regards,
Bradley Smith
--
Bradley Smith brad at brad-smith.co.uk
Debian GNU/Linux Developer bradsmith at debian.org
GPG: 0xC718D347 D201 7274 2FE1 A92A C45C EFAB 8F70 629A C718 D347
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://gmplib.org/list-archives/gmp-bugs/attachments/20090413/0ea4f4cb/attachment.bin>
More information about the gmp-bugs
mailing list