bugGPSD - Bugs: bug #44566, Unused variable warnings with...

 
 

bug #44566: Unused variable warnings with -DNDEBUG

Submitted by:  Kurt Schwehr <schwehr>
Submitted on:  Wed 18 Mar 2015 01:41:42 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Eric S. Raymond <esr>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 18 Mar 2015 12:52:33 PM UTC, comment #2:

If NDEBUG is defined, all asserts turn to nops.

https://sourceware.org/git/?p=glibc.git;a=blob;f=assert/assert.h;h=d04c58cc8a664ec1e568b358a2973395ea8e1192;hb=HEAD

Kurt Schwehr <schwehr>
Wed 18 Mar 2015 02:12:09 AM UTC, comment #1:

Weird that referencing the variable in assert doesn't count as used.

Patch applied, thanks.

Eric S. Raymond <esr>
Project AdministratorIn charge of this item.
Wed 18 Mar 2015 01:41:42 AM UTC, original submission:

With -Werror -DNDEBUG, these two cases end up failing with unused variables (gcc 4.9 with lots of patches on Linux). The attached patch solves the issue for me, but it's possible that it might be better with the UNUSEDs wrapped in #ifdef NDEBUG.

Kurt Schwehr <schwehr>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #33387:  gpsd.diff added by schwehr (785B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by esr (Posted a comment)
  • -unavailable- added by schwehr (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 03 Jun 2015 02:14:14 PM UTCesrOpen/ClosedOpen=>Closed
    Wed 18 Mar 2015 02:12:09 AM UTCesrStatusNone=>Fixed
      Assigned toNone=>esr
    Wed 18 Mar 2015 01:41:42 AM UTCschwehrAttached File-=>Added gpsd.diff, #33387

    Back to the top


    Powered by Savane 3.1-cleanup1