If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

_PR_MD_INIT_CONTEXT for w9x needs to set status, or pruthr.c needs to change its behavior

RESOLVED FIXED in 4.5.1

Status

NSPR
NSPR
RESOLVED FIXED
14 years ago
14 years ago

People

(Reporter: timeless, Assigned: Wan-Teh Chang)

Tracking

other
4.5.1
x86
Windows XP

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

14 years ago
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
(Reporter)

Comment 1

14 years ago
Created attachment 138987 [details]
Preprocessed _PR_CreateThread
(Assignee)

Comment 2

14 years ago
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
(Reporter)

Comment 3

14 years ago
Created attachment 139328 [details] [diff] [review]
per wtc. builds on wXP
(Reporter)

Updated

14 years ago
Attachment #139328 - Flags: review?(wchang0222)
(Assignee)

Comment 4

14 years ago
Comment on attachment 139328 [details] [diff] [review]
per wtc. builds on wXP

r=wtc.	Thanks for the patch, timeless.
Attachment #139328 - Flags: review?(wchang0222) → review+
(Assignee)

Comment 5

14 years ago
Patch checked into the NSPR tip (NSPR 4.5.1) and
NSPRPUB_PRE_4_2_CLIENT_BRANCH (Mozilla 1.7a).
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.5.1
You need to log in before you can comment on or make changes to this bug.