- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the following lines of code in my sourcefiles:
Regions.push_back(tuple(0.95, 1.0));
this->cStream_Frame_Duration.push_back(0);
this->cStream_Number_of_Keyframes.push_back(0);
this->cpLast_Frames.push_back ( NULL );
Those are vectors from a STL implementation on which push_back() is performed.
On all lines the following remark appears:
remark #383: value copied to temporary, reference to temporary used
How can I change the code so that the remark doesn't appear?
What causes the remark to appear?
Regards
R4DIUM
Regions.push_back(tuple
this->cStream_Frame_Duration.push_back(0);
this->cStream_Number_of_Keyframes.push_back(0);
this->cpLast_Frames.push_back ( NULL );
Those are vectors from a STL implementation on which push_back() is performed.
On all lines the following remark appears:
remark #383: value copied to temporary, reference to temporary used
How can I change the code so that the remark doesn't appear?
What causes the remark to appear?
Regards
R4DIUM
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeh, in this case vector::push_back(const T& in), it's not important. Compiler should know that "&in" is not saved anywhere.
We're working on to reduce this type of warning/remarks. This remark is on the list. Once the compiler is ready, I should post a news here.
Thanks!
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's because compiler has to generate objects for those parameters:
tuple
0
NULL
if this->cpLast_Frames is "vector
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - JENNIFER JIANG (Intel)
It's because compiler has to generate objects for those parameters:
tuple
0
NULL
if this->cpLast_Frames is "vector
And why is this important?
Is it because the created objects had a short constructor lifetime in old compilers and
were destroyed even if they were referenced by a internal class reference?
under
ISO-28. Temporary used to init reference not an error (No diagnostic in aCC6)
Regards R4DIUM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeh, in this case vector::push_back(const T& in), it's not important. Compiler should know that "&in" is not saved anywhere.
We're working on to reduce this type of warning/remarks. This remark is on the list. Once the compiler is ready, I should post a news here.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Could this remark be caused by a real() call to a complex value?
Thanks
Could this remark be caused by a real() call to a complex
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - mfactor
Hello,
Could this remark be caused by a real() call to a complex value?
Thanks
Could this remark be caused by a real() call to a complex
Thanks
Hello all,
this remark is disabled in 11.1. you can only see it with /W5
Jennifer
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page