[PATCH] replace: Replace BSD strtoll by wrapping strtoll instead of strtoq

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue May 5 02:20:44 MDT 2015

On Sun, May 03, 2015 at 08:40:57AM +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.

Isn't the point that we want to replace strtoll with
something different, not with exactly the function we want
to replace? I could see special error handling on top of
strtoll/EINVAL. Alternatively, we should fully implement
strtoll ourselves for the platforms that neither have
strtoll the way we expect it nor strtoq.

With best regards,

Volker Lendecke

SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de

More information about the samba-technical mailing list