[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using long long and printf("%m") in debian



On 18-Aug-06, 16:48 (CDT), Hendrik Sattler <post@hendrik-sattler.de> wrote: 
> 
> No, %m is, according to printf(2) manpage:
> m      (Glibc extension.)  Print output of strerror(errno).  No argument is 
> required.
> 
> So why isn't
>  printf("%s\n",strerror(errno));
> used instead of
>  printf("%m\n");
> ?
> Not like a problem in Debian GNU/* but you should tell upstream about 
> questionable coding style and portability.

The "%m" idiom is pretty widespread, actually, and not only a Glibc
extension. But the "strerror(errno)" form is definitely superior for
portability.

Steve


-- 
Steve Greenland
    The irony is that Bill Gates claims to be making a stable operating
    system and Linus Torvalds claims to be trying to take over the
    world.       -- seen on the net



Reply to: