On 02/08/2019 04:12, Inada Naoki wrote: > On Thu, Aug 1, 2019 at 10:21 PM Victor Stinner <vstin...@redhat.com> wrote: >> Hi INADA-san, >> >> Is it supported on macOS, FreeBSD, AIX, Android, etc.? >> >> My notes on platforms supported by Python: >> https://pythondev.readthedocs.io/platforms.html >> >> For example, xlc C compiler seems to be commonly used on AIX. I don't >> know how is its C99 support. >> >> Can we write an unit test somewhere to ensure that %zd works as expected? >> >> Victor >> > I don't know about AIX too. I googled, but I can not find even man manual for > snprintf(3) on AIX. > > I'm frustrated I wasted a few hours to read some PDFs and searching > but I can not > find any official document about snprintf(3). > I feel it's impossible to support such platforms...
AIX man pages "group" printf() functions together on one page. During a quick search I found a man page for AIX 4.3.3 (which is roughly 1997), and also for AIX 7.2. So the core function is there (in libc.a). I do not have any systems older than AIX 5.3 - and a much too simplified program (printf(), sprintf(), snprintf() all support the same formatting arguments. In the documentation I do not see any reference to %z... support (although I do see support for vectors using %v...). As to XLC and c99, etc.. FYI: when called as "cc" the compiler behavior is "pre-c99", whatever that may be. For strict c99 you call it as c99. I call it as xlc and xlc_r to get c99 and some other extensions by default. The only thing you need remember is that XLC supports, for years, various standards - including c99. Just not, by default, if called as "cc". Further, (imho) it is not the compiler that "supports" a particular printf() format - rather the compiler verifies the syntax, does the work for the call - but the actual support is provided by libc.a - which is maintained by core AIX - not the compiler developer/maintainers. OK - a too simple program - run on AIX 5.3 - seems to indicate that XLC (version 11, so quite old!) accepts "%zd". If someone would be kind enough to mail me a better example of what needs to be verfied - I am happy to compile and publish the results. root@x065:[/data/prj/aixtools/tests]cat printf-test.c #include <stdio.h> main() { printf("Hello World - testing for %%zd support\n"); printf("%%zd of 1001 == %zd\n", 1001); printf("\nTest complete\n"); } oot@x065:[/data/prj/aixtools/tests]./a.out Hello World - testing for %zd support %zd of 1001 == 1001 Test complete fyi: AIX 4.3 https://sites.ualberta.ca/dept/chemeng/AIX-43/share/man/info/C/a_doc_lib/libs/basetrf2/snprintf.htm and AIX 7.2 https://www.ibm.com/support/knowledgecenter/ssw_aix_72/p_bostechref/printf.html > Except AIX, I believe all platforms supports size_t and %zd because > it's very basic > C99 feature. > > Regards, > -- > Inada Naoki <songofaca...@gmail.com> > _______________________________________________ > Python-Dev mailing list -- python-dev@python.org > To unsubscribe send an email to python-dev-le...@python.org > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/O7H4FBLDQBHSKGSEJQ2TU7IRNKUAPJDV/
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/O55OVT5ORYQGBGVTJXIGQMXDO4D3F5Y4/