Danny Backx wrote:
> On Tue, 2007-06-19 at 19:52 -0600, Ximsce wrote:
>> Pedro Alves wrote:
>>> You didn't NULL terminate the argument list:
>>> http://www.opengroup.org/onlinepubs/000095399/functions/exec.html
>>>
>>> "The argument argv is an array of character pointers to
>>> null-terminated strings. The application shall ensure that the last
>>> member of this array is a null pointer. These strings shall constitute
>>> the argument list available to the new process image. The value in
>>> argv[0] should point to a filename that is associated with the process
>>> being started by one of the exec functions."
> 
> Even though the comments about the argv argument are accurate, this may
> not be the right reference to quote from. 
> 
> I've been looking for reference material on MSDN. Here's one :
> http://msdn2.microsoft.com/en-us/library/431x4c1w(VS.80).aspx
> 

Look closer.  Those functions don't exist on
coredll.dll.  You're looking at docs for the desktop versions
of Windows.  The OP posted code that is compilable with
cegcc, which uses newlib as CRT.  Opengroup is definitely a
better reference than MSDN, since MSFT is known to subvert standards
at will.  If we were talking about mingw32ce, then you would be
right, since in that case, we want to be as compatible as possible
with MSVC for WinCE/Devices, MinGW, MSVC for desktop, and only if there
aren't colisions, with what opengroup ratifies.

> With execv the original application is *replaced* by the second one, so
> the END: text is never printed, the "Execution Complete" dialog is never
> shown.
> 
> With spawnv, both do happen.
> 

Agreed.

(I'm sure there are a huge amount a bugs with our exec*/spawn*
implementations in newlib/libc/sys/wince, though.)

I suggest the OP to do a similar test in linux or cygwin first,
and only then try it on cegcc.

Cheers,
Pedro Alves


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to