lua-users home
lua-l archive

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


Marc Balmer <marc@msys.ch> wrote:
> I don't know if %s is in ISO C 99 or POSIX, but OS X certainly supports
> it.

Someone else has already noted that it doesn’t seem to be in C99 or C11.

One other point for what it’s worth: Python doesn’t prove ‘%s’ for
strftime, Ruby does, and Perl’s POSIX core module doesn’t list ‘%s’ among
the conversion specifiers that are portable. (Though Perl’s POSIX-GNU
module—a POSIX module with GNU extensions—does provide ‘%s’.)

I mention this because if you wanted to check what it would take to try to
make ‘%s’ (somewhat?) portable, you might take a look at Ruby MRI (i.e. the
source code for the standard Ruby interpreter). I can’t imagine they would
include it without warning unless they had done something to provide it on
all the operating systems that they support. (Though maybe their mention of
“the Unix Epoch” is an implicit warning.)

Best, P
-- 
We have not been faced with the need to satisfy someone else's
requirements, and for this freedom we are grateful.
    Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System