[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] [PATCH] win32: add include/getopt.h with static imple
Re: [Tinycc-devel] [PATCH] win32: add include/getopt.h with static implementation
Tue, 30 Jul 2019 16:03:40 +0000 (UTC)
Alpine 2.21 (LSU 202 2017-01-01)
On Fri, 26 Jul 2019, avih via Tinycc-devel wrote:
> Patch is attached. If there are no objections, I'll push it in few days.
But why? TCC is a compiler, it doesn't generally provide a C library.
Use newlib or musl or the like for that.
The underlying objection is basically the answer to the question "where
do you stop?" So we then would have getopt. Why would we not have nftw,
or regexec/regcompile, or getcwd, or any of the other POSIX functions?
So, please no.
> From the commit message:
> This is a POSIX compliant implementation of getopt (short options).
> It passes all tests of gnu getopt in posixly-correct mode, with
> additional safeguards against out-of-bounds access (optind, optpos).
> Reset is supported via optind or optreset.
> For simplicity, the implementation is static at the header, and it
> uses stdio.h and string.h (could be avoided with some more code).