ntdll: CreateRemoteThread and RtlCreateUserThread for remote processes, take 2

Dan Kegel dank at kegel.com
Wed Aug 2 21:40:49 CDT 2006

On 8/2/06, Mike McCormack <mike at codeweavers.com> wrote:
> > ["void *foo" is better than "void *foo = NULL", you want it
> > to remain uninitialized because that way the compiler will warn]
> gcc version 4.1.2 20060729 (prerelease) (Debian 4.1.1-10)
> mike at black:~/wine$ cat foobar.c
> void foo(int *);
> void bar(void) { int x; if(x) foo(&x); }
> mike at black:~/wine$ gcc -Wall -c foobar.c
> mike at black:~/wine$
> Superior, if the compiler did happen to warn you...

No fair, Mike, you should have given the link to the PR:

Many similar errors will get caught, as long as you turn on the
optimizer with -O (otherwise the compiler can't detect them).

It does warn on the use of x as long as you avoid the specific case of PR19430.
For instance:

$ cat foobar.c
void foo(int *x);
void bar(void) { int x; int y; if (x) foo(&y); }
$ gcc -O -Wall -c foobar.c
foobar.c: In function `bar':
foobar.c:2: warning: `x' might be used uninitialized in this function

Thanks for pointing out that bug.  I'll nag some compiler folk about it.
- Dan

More information about the wine-devel mailing list