This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with latest setup-x86.exe

Corinna Vinschen wrote:
>I just explained that in a reply an the cygwin-apps list:
>I applied a patch to setup which should fix the issue.

I grabbed the latest source (which has the nt_fopen in it)
and built it without the argv patch, but it still has the same
problem. __argv is always zero.

So, I tried the following under cygwin's mingw32:

#include <stdio.h>
#include <stdlib.h>

/* extern char *** __p___argv(void); */

#if 1
#define argc _argc
#define argv _argv

#if 0
#define argc __argc
#define argv __argv

int main(int argc, char **argv, char **envp)
register int i;

printf ("_argc = 0x%x\n", _argc);
printf ("__argc = 0x%x\n", __argc);
printf ("__p___argc() = 0x%x\n", __p___argc());
printf ("*(__p___argc()) = 0x%x\n", *(__p___argc()));
printf ("\n");
printf ("_argv = 0x%x\n", _argv);
printf ("__argv = 0x%x\n", __argv);
printf ("__p___argv() = 0x%x\n", __p___argv());
printf ("*(__p___argv()) = 0x%x\n", *(__p___argv()));
printf ("\n");

printf("argc=%d\n", argc);
for (i=0; i<argc; i++)
printf("argv[%d]=%s\n", i, argv[i]);

and then I ran it on my machine and four other windows 7 pro machines
using "tst abc def" and get:

_argc = 0x3
__argc = 0x0
__p___argc() = 0x755830e4
*(__p___argc()) = 0x0

_argv = 0x5b1680
__argv = 0x0
__p___argv() = 0x755830c0
*(__p___argv()) = 0x0


on all these machines.

I don't know how that for loop on __argv in can work with __argv
always returning zero, but admittedly setup.exe does work
on some of these machines without my changes, just not on others.
My changes produce a setup that does work on all of them.
I have to admit I haven't been able to figure out what __argv really
does since it always returns zero on any machine I try.  So, I'm still

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]