Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313817 - False "Statement has no effect" warnings on assignment of class instances.
Summary: False "Statement has no effect" warnings on assignment of class instances.
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.0   Edit
Assignee: Elena Laskavaia CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 17:19 EDT by Vadym Krevs CLA
Modified: 2010-07-28 15:29 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vadym Krevs CLA 2010-05-20 17:19:05 EDT
Build Identifier: I20100518-0800

Create a new CPP file containing
#include <string>
std::string gettempdir()
{
    return "Hello";
}
void foo()
{
    std::string jailDir;
    jailDir = gettempdir();

    chdir(jailDir);
}

Problem analysis highlights "jaildir=gettempdir()" and adds  a "Statement has no effect" warning to the problems list.

Assignment of primitive types does not seem to be affected.

Reproducible: Always
Comment 2 Elena Laskavaia CLA 2010-05-22 22:29:19 EDT
fixed
Comment 3 CDT Genie CLA 2010-07-28 15:29:12 EDT
*** cdt cvs genie on behalf of elaskavaia ***
Bug 313817 Fixed f.p. when assignment is overloaded operator

[*] StatementHasNoEffectChecker.java 1.12 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/StatementHasNoEffectChecker.java?root=Tools_Project&r1=1.11&r2=1.12