Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86 Copyright (C) Microsoft Corporation 1984-2001. All rights reserved. (mozilla trunk from today) r:\mozilla\nsprpub\pr\src\threads\combined\pruthr.c(1339) : warning C4700: local variable 'status' used without having been initialized logic still exists on trunk today: [head] pruthr.c 1337 _PR_MD_INIT_CONTEXT(thread, top, _PR_UserRunThread, &status); [head] primpl.h 1040 #define _PR_MD_INIT_CONTEXT _MD_INIT_CONTEXT [head] _win95.h 439 #define _MD_INIT_CONTEXT
Thanks for the bug report. It is indeed an uninitialized variable. Moreover, the preprocessed _PR_CreateThread you provided shows how broken the _MD_INIT_CONTEXT in _win95.h is. Fortunately the code in question will never be executed in the "WIN95" configuration of NSPR. The _MD_INIT_CONTEXT macro in _os2.h, _solaris.h (at line 361), and _win95.h should be defined to do *status = PR_TRUE; to eliminate this (benign) compiler warning. I think we could just say: #define _MD_INIT_CONTEXT(_thread, _sp, _main, status) *status = PR_TRUE A better definition would be: #define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \ PR_BEGIN_MACRO \ *status = PR_TRUE; \ PR_END_MACRO
Comment on attachment 139328 [details] [diff] [review] per wtc. builds on wXP r=wtc. Thanks for the patch, timeless.
Patch checked into the NSPR tip (NSPR 4.5.1) and NSPRPUB_PRE_4_2_CLIENT_BRANCH (Mozilla 1.7a).