bugGNU Octave - Bugs: bug #55935, Useless...

 
 

bug #55935: Useless "new_sid->m_name;" in octave::symbol_scope_rep::dup

Submitter:  Andrew Janke <apjanke>
Submitted:  Sat 16 Mar 2019 01:31:31 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Release: 
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 19 Mar 2019 04:29:19 PM UTC, comment #2: 

For now, I pushed this change to remove the useless statemnet:

http://hg.savannah.gnu.org/hgweb/octave/rev/a75d1e82a7d3

Closing as fixed.

John W. Eaton <jwe>
Group administrator
Sat 16 Mar 2019 01:44:17 PM UTC, comment #1: 

My aim is to remove these dup methods, or at least remove the need for the symbol_scope parameter.  My recent changes to support handles to nested functions is a step in that direction but I'm not sure we are quite to the point where it can be removed.  I'll check out this specific issue though, hopefully later today.  Thanks.

John W. Eaton <jwe>
Group administrator
Sat 16 Mar 2019 01:31:31 PM UTC, original submission:  

In libinterp/corefcn/symscope.h at line 120:


    std::shared_ptr<symbol_scope_rep> dup (void) const
    {
      std::shared_ptr<symbol_scope_rep> new_sid
        = std::shared_ptr<symbol_scope_rep> (new symbol_scope_rep (m_name));

      new_sid->m_name;


That "new_sid->m_name;" statement is a no-op, I think. Should it actually be initialized from this's m_name? Or some other source?

Causes a warning in clang:


In file included from ../../octave/libinterp/corefcn/errwarn.cc:27:
In file included from ../../octave/libinterp/corefcn/defun.h:32:
In file included from ../../octave/libinterp/corefcn/defun-int.h:30:
In file included from ../../octave/libinterp/octave-value/ov-builtin.h:32:
In file included from ../../octave/libinterp/octave-value/ov-fcn.h:36:
../../octave/libinterp/corefcn/symscope.h:120:16: warning: expression result unused [-Wunused-value]
      new_sid->m_name;
      ~~~~~~~  ^~~~~~


Andrew Janke <apjanke>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by apjanke (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-19 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code