Mailing List Archive

That amd64 segfault again
I thought I should attach the patch I'm about to apply to libspf2 in Debian. I
started with the patch posted by Thomas Jacob to the Debian bug report
(http://bugs.debian.org/392793) and merged with the one from Herbert Straub.
Then I moved the changes that just cast the arguments to SPF_Infof() and
SPF_Debugf() into a separate patch and instead changed the format strings.
But how portable is the z flag to printf()? (From the manpage: "A following
integer conversion corresponds to a size_t or ssize_t argument.").

--
Magnus Holmgren holmgren@lysator.liu.se
(No Cc of list mail needed, thanks)

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?list_id=1007
Re: That amd64 segfault again [ In reply to ]
As long as you are only adding this patch
to the Debian package, I shouldn't think that there
is a portability problem, Debian uses the same
glibc version on all its support platforms, or don't they?

But generally I think that I would be more portable
if you just used %d and a type cast, the numbers
involved should always be less than MAX_INT, and explicit
type casting like that shouldn't break code anywhere...


On Sat, 2007-03-24 at 10:38 +0100, Magnus Holmgren wrote:
> I thought I should attach the patch I'm about to apply to libspf2 in Debian. I
> started with the patch posted by Thomas Jacob to the Debian bug report
> (http://bugs.debian.org/392793) and merged with the one from Herbert Straub.
> Then I moved the changes that just cast the arguments to SPF_Infof() and
> SPF_Debugf() into a separate patch and instead changed the format strings.
> But how portable is the z flag to printf()? (From the manpage: "A following
> integer conversion corresponds to a size_t or ssize_t argument.").

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?list_id=1007
Re: That amd64 segfault again [ In reply to ]
On Monday 26 March 2007 05:24, Thomas Jacob wrote:

> On Sat, 2007-03-24 at 10:38 +0100, Magnus Holmgren wrote:
> > I thought I should attach the patch I'm about to apply to libspf2 in
> > Debian. I started with the patch posted by Thomas Jacob to the Debian bug
> > report (http://bugs.debian.org/392793) and merged with the one from
> > Herbert Straub. Then I moved the changes that just cast the arguments to
> > SPF_Infof() and SPF_Debugf() into a separate patch and instead changed
> > the format strings. But how portable is the z flag to printf()? (From the
> > manpage: "A following integer conversion corresponds to a size_t or
> > ssize_t argument.").
>
> As long as you are only adding this patch
> to the Debian package, I shouldn't think that there
> is a portability problem, Debian uses the same
> glibc version on all its support platforms, or don't they?

There are packages that have specific versions for specific architectures, so
I don't think this is a safe assumption.

> But generally I think that I would be more portable
> if you just used %d and a type cast, the numbers
> involved should always be less than MAX_INT, and explicit
> type casting like that shouldn't break code anywhere...

I think the more portable the better. It would also make the patches more
useful upstream once they (he) restarts maintaining libspf2.

Scott K

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?list_id=1007
Re: That amd64 segfault again [ In reply to ]
On Monday 26 March 2007 16:44, Scott Kitterman wrote:
> On Monday 26 March 2007 05:24, Thomas Jacob wrote:
> > On Sat, 2007-03-24 at 10:38 +0100, Magnus Holmgren wrote:
> > > I thought I should attach the patch I'm about to apply to libspf2 in
> > > Debian. I started with the patch posted by Thomas Jacob to the Debian
> > > bug report (http://bugs.debian.org/392793) and merged with the one from
> > > Herbert Straub. Then I moved the changes that just cast the arguments
> > > to SPF_Infof() and SPF_Debugf() into a separate patch and instead
> > > changed the format strings. But how portable is the z flag to printf()?
> >
> > But generally I think that I would be more portable
> > if you just used %d and a type cast, the numbers
> > involved should always be less than MAX_INT, and explicit
> > type casting like that shouldn't break code anywhere...
>
> I think the more portable the better. It would also make the patches more
> useful upstream once they (he) restarts maintaining libspf2.

I'll do so, especially for this reason.

--
Magnus Holmgren holmgren@lysator.liu.se
(No Cc of list mail needed, thanks)

-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?list_id=1007