Closed Bug 707130 Opened 8 years ago Closed 8 years ago

Fix GCC 4.6 warnings coming from callgrind macros in jsdbgapi.cpp

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set

Tracking

()

RESOLVED WORKSFORME
mozilla11

People

(Reporter: igor, Assigned: igor)

Details

Attachments

(2 files)

When I configure with --enable-callgrind GCC 4.6 generates the following warnings:

/home/igor/m/mc/js/src/jsdbgapi.cpp:1492:24: warning: variable ‘_qzz_res’ set but not used [-Wunused-but-set-variable]
/home/igor/m/mc/js/src/jsdbgapi.cpp:1493:24: warning: variable ‘_qzz_res’ set but not used [-Wunused-but-set-variable]
/home/igor/m/mc/js/src/jsdbgapi.cpp: In function ‘JSBool js_StopCallgrind()’:
/home/igor/m/mc/js/src/jsdbgapi.cpp:1500:24: warning: variable ‘_qzz_res’ set but not used [-Wunused-but-set-variable]
/home/igor/m/mc/js/src/jsdbgapi.cpp: In function ‘JSBool js_DumpCallgrind(const char*)’:
/home/igor/m/mc/js/src/jsdbgapi.cpp:1508:28: warning: variable ‘_qzz_res’ set but not used [-Wunused-but-set-variable]
/home/igor/m/mc/js/src/jsdbgapi.cpp:1510:28: warning: variable ‘_qzz_res’ set but not used [-Wunused-but-set-variable]

These warnings comes from the expansions of the callgrind macros. It would be nice to fix this.
Summary: Fix GCC 4.6 warnings coming from callgrind macros → Fix GCC 4.6 warnings coming from callgrind macros in jsdbgapi.cpp
Attached patch warnings fixSplinter Review
The patch wraps the CALLGRIND macro calls into WRAP_CALLGRIND macro. That in turn uses the GCC pragma machinery to disable the warnings when the macro expands.
Attachment #578544 - Flags: review?(jorendorff)
jason - review ping?
Comment on attachment 578544 [details] [diff] [review]
warnings fix

Sorry. I missed the email.
Attachment #578544 - Flags: review?(jorendorff) → review+
https://hg.mozilla.org/mozilla-central/rev/42b463638e25
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
Apparently the patch is not enough to fix the warning in optimized builds.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The easy fix for this is to update your Valgrind installation.
Apparently _Pragma("GCC diagnostic push") and friends are not reliablewhen used  inside function bodies. So the patch moves the pragmas outside function declarations.
Attachment #581738 - Flags: review?(jorendorff)
Comment on attachment 581738 [details] [diff] [review]
extra warning fix

Fine with me, but in the meantime Waldo made it work for clang, so please retain that.
Attachment #581738 - Flags: review?(jorendorff) → review+
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.