Re: [PATCH] ash: avoid GLIBC'ism %m

2017-08-04 Thread Johannes Schindelin
Hi Markus, On Wed, 19 Jul 2017, Markus Gothe wrote: > However it should be noted that this [scanf's %m format] seems not to be > the same as glibc %m: "To use the dynamic allocation conversion > specifier in C99 and C11, specify m as a length modifier as per > POSIX.1-2008. That is, use %ms or

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-08-03 Thread Johannes Schindelin
Hi Denys, On Sun, 23 Jul 2017, Denys Vlasenko wrote: > On Sat, Jul 22, 2017 at 8:56 PM, Johannes Schindelin > wrote: > > On Fri, 21 Jul 2017, Denys Vlasenko wrote: > > > >> On Wed, Jul 19, 2017 at 3:47 AM, Jody Bruchon wrote: > >> > On

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-25 Thread Kang-Che Sung
On Mon, Jul 24, 2017 at 3:34 AM, Denys Vlasenko wrote: > On Sat, Jul 22, 2017 at 8:56 PM, Johannes Schindelin > wrote: >> On Fri, 21 Jul 2017, Denys Vlasenko wrote: >> >>> On Wed, Jul 19, 2017 at 3:47 AM, Jody Bruchon

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-25 Thread Denys Vlasenko
On Sun, Jul 23, 2017 at 9:34 PM, Denys Vlasenko wrote: > On Sat, Jul 22, 2017 at 8:56 PM, Johannes Schindelin > wrote: >> On Fri, 21 Jul 2017, Denys Vlasenko wrote: >> >>> On Wed, Jul 19, 2017 at 3:47 AM, Jody Bruchon

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-23 Thread Denys Vlasenko
On Sat, Jul 22, 2017 at 8:56 PM, Johannes Schindelin wrote: > On Fri, 21 Jul 2017, Denys Vlasenko wrote: > >> On Wed, Jul 19, 2017 at 3:47 AM, Jody Bruchon wrote: >> > On 2017-07-18 9:15 PM, Kang-Che Sung wrote: >> >> >> >> On Wed, Jul 19, 2017

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-22 Thread Kang-Che Sung
On Sun, Jul 23, 2017 at 10:03 AM, Kang-Che Sung wrote: > > How about wrapping the printf("%m") uses within the __GNU_LIBRARY__ macro? > It seems that %m support has been there from the beginning of glibc. Correction. It's since glibc 1.06. I've looked in the old ChangeLog

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-22 Thread Kang-Che Sung
On Sun, Jul 23, 2017 at 4:33 AM, Michael Conrad wrote: > On 7/22/2017 2:56 PM, Johannes Schindelin wrote: >> >> No, not every libc. I would not have spent the time and effort to develop >> the patch, contribute it, rework it and contribute a second iteration if >> it was

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-22 Thread Michael Conrad
On 7/22/2017 2:56 PM, Johannes Schindelin wrote: Hi Denys, On Fri, 21 Jul 2017, Denys Vlasenko wrote: On Wed, Jul 19, 2017 at 3:47 AM, Jody Bruchon wrote: On 2017-07-18 9:15 PM, Kang-Che Sung wrote: On Wed, Jul 19, 2017 at 2:11 AM, Markus Gothe

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-22 Thread Johannes Schindelin
Hi Denys, On Fri, 21 Jul 2017, Denys Vlasenko wrote: > On Wed, Jul 19, 2017 at 3:47 AM, Jody Bruchon wrote: > > On 2017-07-18 9:15 PM, Kang-Che Sung wrote: > >> > >> On Wed, Jul 19, 2017 at 2:11 AM, Markus Gothe > >> wrote: > >>> > >>> Actually

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-21 Thread Denys Vlasenko
On Wed, Jul 19, 2017 at 3:47 AM, Jody Bruchon wrote: > On 2017-07-18 9:15 PM, Kang-Che Sung wrote: >> >> On Wed, Jul 19, 2017 at 2:11 AM, Markus Gothe >> wrote: >>> >>> Actually last time I checked ‘%m’ is POSIX contrary to glibc’s deprecated >>>

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-19 Thread Markus Gothe
Ah, my mistake! Seems like I mixed the two up and made the assumption that they were the same for both scanf and printf. On 19 Jul 2017, at 20:37 , Jody Bruchon wrote: > On 2017-07-19 14:34, Markus Gothe wrote: >> Look over here >>

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-19 Thread Jody Bruchon
On 2017-07-19 14:34, Markus Gothe wrote: Look over here http://pubs.opengroup.org/onlinepubs/9699919799/functions/scanf.html instead: The %m in BusyBox is a printf specifier, not a scanf specifier. How is this link relevant to printf("%m")? ___

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-19 Thread Markus Gothe
However it should be noted that this seems not to be the same as glibc %m: "To use the dynamic allocation conversion specifier in C99 and C11, specify m as a length modifier as per POSIX.1-2008. That is, use %ms or %m[…]." So I guess, the basic assumption of not using %m for errors is correct.

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-19 Thread Markus Gothe
Look over here http://pubs.opengroup.org/onlinepubs/9699919799/functions/scanf.html instead: [CX] The %c, %s, and %[ conversion specifiers shall accept an optional assignment-allocation character 'm', which shall cause a memory buffer to be allocated to hold the string converted including a

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-18 Thread Jody Bruchon
On 2017-07-18 9:15 PM, Kang-Che Sung wrote: On Wed, Jul 19, 2017 at 2:11 AM, Markus Gothe wrote: Actually last time I checked ‘%m’ is POSIX contrary to glibc’s deprecated '%a’. However, I agree that it should not be used since at least uClibc can be built without

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-18 Thread Kang-Che Sung
On Wed, Jul 19, 2017 at 2:11 AM, Markus Gothe wrote: > Actually last time I checked ‘%m’ is POSIX contrary to glibc’s deprecated > '%a’. > However, I agree that it should not be used since at least uClibc can be > built without support for it. How come %m is POSIX

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-18 Thread Markus Gothe
Actually last time I checked ‘%m’ is POSIX contrary to glibc’s deprecated '%a’. However, I agree that it should not be used since at least uClibc can be built without support for it. BR, Markus - The panama-hat hacker On 17 Jul 2017, at 04:01 , Kang-Che Sung wrote: > I

Re: [PATCH] ash: avoid GLIBC'ism %m

2017-07-16 Thread Kang-Che Sung
I wonder if there's a better solution to this. BusyBox has bb_perror_msg() and like. Maybe using these API's are better? On Mon, Jul 17, 2017 at 4:08 AM, Johannes Schindelin wrote: > GLIBC's printf() family supports the extension where the placeholder %m > is

[PATCH] ash: avoid GLIBC'ism %m

2017-07-16 Thread Johannes Schindelin
GLIBC's printf() family supports the extension where the placeholder %m is interpolated to strerror(errno). This is not portable. So don't use it. (It was only used in ash's source code to begin with.) Signed-off-by: Johannes Schindelin --- Published-As: