On Mon, Aug 28, 2017 at 12:18 PM, Denys Vlasenko wrote: > glibc/uclibc need more extensive changes, since they use a pointer to store > the position. This is a test in busybox tree which fails miserably > because of that: > > https://git.busybox.net/busybox/tree/shell/hush_test/hush-getopts/getopt_test_libc_bug.tests > # This test can fail with libc with buggy getopt() implementation. > # If getopt() wants to parse multi-option args (-abc), > # it needs to remember a position within current arg. > # > # If this position is kept as a POINTER, not an offset, > # and if argv[] ADDRESSES (not contents!) change, it blows up. uclibc would need something like this patch (not tested at all):