bugGNU RCS - Bugs: bug #40091, rcs.c:1034: = / == mixup ?

 
 

bug #40091: rcs.c:1034: = / == mixup ?

Submitted by:  David Binderman <dcb314>
Submitted on:  Mon 23 Sep 2013 07:57:43 AM UTC  
 
Category: NoneSeverity: 4 - Important
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Thien-Thi Nguyen <ttn>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 24 Sep 2013 03:39:48 AM UTC, comment #3:

I have installed the fix:

http://git.savannah.gnu.org/cgit/rcs.git/commit/?h=p&id=b85b0c3cf2

Closing this bug now.

Thien-Thi Nguyen <ttn>
Project AdministratorIn charge of this item.
Mon 23 Sep 2013 11:18:27 AM UTC, comment #2:

>BTW, what system do you see this on?


Redhat Linux 19 on AMD Phenom.

David Binderman <dcb314>
Mon 23 Sep 2013 10:45:34 AM UTC, comment #1:

Thanks for reporting this. Good catch.

I confirm that "==" is incorrect and should be replaced by "=". Will followup when that change is installed. (This bug report has prompted me to replace #if OPEN_O_BINARY .. #endif with direct use of OPEN_O_BINARY, first, increasing compiler visibility on this class of error.)

I'm bumping the severity to Important because the error affects non-POSIX systems, which are generally under-tested (by me, at least). BTW, what system do you see this on?

Thien-Thi Nguyen <ttn>
Project AdministratorIn charge of this item.
Mon 23 Sep 2013 07:57:43 AM UTC, original submission:

I just ran the static analysis tool "cppcheck" over the
source code of rcs-5.9.0

It said

[rcs.c:1034]: (warning) String literal compared with variable 'diffp'. Did you intend to use strcmp() instead?

Source code is

if (BE (kws) == kwsub_b)
*++diffp == "--binary";

Perhaps something like

if (BE (kws) == kwsub_b)
*++diffp = "--binary";

was intended.

David Binderman <dcb314>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ttn (Posted a comment)
  • -unavailable- added by dcb314 (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 24 Sep 2013 03:39:48 AM UTCttnStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Mon 23 Sep 2013 10:45:34 AM UTCttnSeverity3 - Normal=>4 - Important
      StatusNone=>Confirmed
      Assigned toNone=>ttn

    Back to the top


    Powered by Savane 3.1-cleanup1