[Top][All Lists]

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

Re: [Tinycc-devel] spawnvp V.S. _spawnvp on Windows

From: Christian Jullien
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
Sent: mercredi 18 mai 2016 14:55
To: address@hidden
Subject: Re: [Tinycc-devel] spawnvp V.S. _spawnvp on Windows


Hello Christian,

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:


diff --git a/tcc.c b/tcc.c

index 93ed4de..b340d9b 100644 (file)

--- a/tcc.c

+++ b/tcc.c

@@ -133,7 +133,7 @@ static void help(void)

 #include <process.h>

 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)

         return ret;

     cwait(&ret, ret, WAIT_CHILD);



From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=address@hidden] On Behalf Of Christian Jullien
Sent: lundi 16 mai 2016 10:12
To: address@hidden
Subject: [Tinycc-devel] spawnvp V.S. _spawnvp on Windows




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?



Tinycc-devel mailing list


 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]