|Subject:||Re: [Tinycc-devel] spawnvp V.S. _spawnvp on Windows|
|Date:||Wed, 18 May 2016 15:01:54 +0200|
My pleasure :o)
I hate warnings, all the code I write compiles with –Wall with gcc (plus many extra –Wxxx), -W4 with VC++ plus I use splint to check nothing is suspicious.
Splint is really my favorite but the price to pay to have no warning is really high. However, it really helped me to find very obscure bugs no other compilers where able to find (even clang –analyzer).
P.S. don’t try splint on tcc source code.
From: Tinycc-devel [mailto:address@hidden On Behalf Of David Mertens
That was an annoying warning. You patch works for me on my flavors of Windows on the toolchain provided by Strawberry Perl. Thanks!
On Tue, May 17, 2016 at 12:23 AM, Christian Jullien <address@hidden> wrote:
I pushed this small patch:
static int execvp_win32(const char *prog, char **argv)
- int ret = spawnvp(P_NOWAIT, prog, (const char *const*)argv);
+ int ret = _spawnvp(P_NOWAIT, prog, (const char *const*)argv);
if (-1 == ret)
cwait(&ret, ret, WAIT_CHILD);
When I build tinycc on Windows (both 32/64 bit).
I always get this warning:
../tcc.c:136:39: warning: passing argument 3 of 'spawnvp' from incompatible pointer type [-Wincompatible-pointer-types]
int ret = spawnvp(P_NOWAIT, prog, (const char *const*)argv);
Looking a spawnvp documentation from Microsoft, I get:
This POSIX function is deprecated. Use the ISO C++ conformant spawnvp instead.
So I replaced spawnvp by _spawnvp and no more warning when using mingw32/64 gcc compilers.
Please Windows maintainer (if any), can you consider this very simple change?
"Debugging is twice as hard as writing the code in the first place.
|[Prev in Thread]||Current Thread||[Next in Thread]|