Bug 772343 - leak check macros fail to compile with -Wunused-but-set-variable enabled
Summary: leak check macros fail to compile with -Wunused-but-set-variable enabled
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: valgrind
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-06 21:39 UTC by Henrik Nordström
Modified: 2012-01-27 19:42 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-27 19:42:40 UTC
Type: ---


Attachments (Terms of Use)
Test program using the offending valgrind macros (572 bytes, text/x-csrc)
2012-01-06 21:39 UTC, Henrik Nordström
no flags Details
Proposed patch silencing the gcc warning/error (2.25 KB, patch)
2012-01-06 21:43 UTC, Henrik Nordström
no flags Details | Diff

Description Henrik Nordström 2012-01-06 21:39:17 UTC
Created attachment 551270 [details]
Test program using the offending valgrind macros

Description of problem:

Trying to compile programs using the valgrind leak check macros causes
warnings/errors about _qzz_res being set but unused.

Version-Release number of selected component (if applicable):

valgrind-3.6.1-6.fc16.x86_64

How reproducible:

always

Steps to Reproduce:
1. gcc -O2 -Wunused-but-set-variable test.c
2.
3.
  
Actual results:

Compilation warns/fails with error about _qzz_res being unused but assigned

Expected results:

No warnings/errors emitted by gcc

Additional info:

Comment 1 Henrik Nordström 2012-01-06 21:43:32 UTC
Created attachment 551275 [details]
Proposed patch silencing the gcc warning/error

Adding __attribute__((unused)) to the _qzz_res variable declarations in these macros in include/memcheck.h fixes the problem.

   {__attribute__((unused)) unsigned long _qzz_res;                                      \

Comment 2 Jakub Jelinek 2012-01-27 19:42:40 UTC
Should be fixed in valgrind-3.7.0-1.fc17.


Note You need to log in before you can comment on or make changes to this bug.