[PATCH resend] replace: Replace BSD strtoll by wrapping strtoll instead of strtoq
felix.janda at posteo.de
Mon Jun 22 01:52:02 MDT 2015
Stefan (metze) Metzmacher wrote:
> Am 22.06.2015 um 08:09 schrieb Volker Lendecke:
> > On Sun, Jun 21, 2015 at 12:03:56PM +0200, Felix Janda wrote:
> >> When it is detected that strtoll returns EINVAL not only in the case
> >> that the base is not supported, HAVE_BSD_STRTOLL is declared and
> >> strtoll is replaced. The current replacement code wraps strtoq in
> >> order to replace strtoll and errors out when strtoq is missing.
> >> In order to remove this possible error path, we can use strtoll instead
> >> of strtoq since the code is only used when it is known that strtoll exists.
> >> The fixes a compilation problem on linux systems using musl libc, which
> >> has a BSD-like strtoll but no strtoq.
> > Ok. I'm not 100% sure about whether the replacement function is
> > right. We might have to test for ((nb==0)&&(errno==EINVAL)) instead
> > of just errno==EINVAL, but as this is a change on top of yours, it's
> > probably okay.
> > Reviewed-by: Volker Lendecke <vl at samba.org>
> > Someone else?
> Reviewed-by: me
> Do we need the same for strtoull()?
Ah, yes, you're right. Will send a new patch later.
More information about the samba-technical