[PATCH] Portability patches

Richard Sharpe realrichardsharpe at gmail.com
Thu Oct 9 11:33:45 MDT 2014


On Thu, Oct 9, 2014 at 10:20 AM, Ralph Böhme <rb at sernet.de> wrote:
> On Thu, Oct 09, 2014 at 09:56:52AM -0700, Richard Sharpe wrote:
>> On Thu, Oct 9, 2014 at 9:28 AM, Ralph Böhme <rb at sernet.de> wrote:
>> > Hi all,
>> >
>> > attached please find two simple fixes for non-portable code that
>> > exploded on my FreeBSD 10 testbox (the non-portable code, not the
>> > fixes ;)
>>
>> Hmmm, on the CentOS 6.5 (and thus RHEL 6.x) box I am currently using,
>> it says of %m that:
>>
>>        m      (Glibc  extension.)   Print output of strerror(errno).  No argu-
>>               ment is required.
>
> where does it say that? In man sscanf? The only reference to this text
> I can find is from man printf: <http://linux.die.net/man/3/printf>
>
>> Isn't that going to cause more portability problems?
>
> To reiterate:
>
> a    scanf glibc extension, eg FreeBSD and Solaris don't have it
> m    In SUSv4 [1], but not in SUSv3 [2], supported by glibc since 2.7, FreeBSD
>
> Looks like at least Solaris 11.1 doesn't have m yet, maybe it's in 11.2.
>
> -Ralph
>
> [1] <http://pubs.opengroup.org/onlinepubs/9699919799/functions/sscanf.html>
> [2] <http://pubs.opengroup.org/onlinepubs/009695399/functions/sscanf.html>

D'oh. I looked in the printf man page not the scanf. Objection removed.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)


More information about the samba-technical mailing list