#3589 closed Bugs (fixed)
Compiler could not create assigment operator
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | Component: | serialization | |
Version: | Boost Development Trunk | Severity: | Cosmetic |
Keywords: | Cc: |
Description
Flood of warnings for that issue.
Attachments (2)
Change History (10)
by , 13 years ago
Attachment: | serialization_array.hpp.patch added |
---|
comment:1 by , 13 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
What warnings?
I'm not seeing anything on my two compilers.
wouldn't your change lead to linking issues instead of some warning.
Need more information to address this.
Robert Ramey
comment:2 by , 13 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Hi,
For sure it will not be a linker problem, because operator= is in private section and nobody should access private section. See how ::boost::noncopyable is implemented.
If there is no assignment operator compiler is trying to create one. When fails, generate warning and default assignment operator which makes copy bit by bit, what usually is error prone.
Regards, Seweryn Habdank-Wojewodzki.
follow-up: 5 comment:3 by , 13 years ago
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
"If there is no assignment operator compiler is trying to create one. When fails, generate warning and default assignment operator which makes copy bit by bit, what usually is error prone."
Hmmm - are you quite sure? I was sure that the default assigment was element by element rather than bit by bit.
Having said that, I still get no warning in any of 200 tests. I test with MSVC 7.1 and gcc 4.3.2. That is, it still works for me.
Let me know what compiler you're using and include a small example which emits this warning.
Robert Ramey
comment:4 by , 13 years ago
I guess that the compiler is some version of MSVC, and it's being run with /W4. You get the warning from the test_array.cpp regression test if you build it in VC9 with /W4 - i've attached a snippet of the warning message.
I'd guess that the warning is because the "std::size_t const m_element_count;" member is preventing the compiler from auto-generating an assignment operator. Doesn't really matter unless you actually want to assign the array, but the warning it produces is quite large.
by , 13 years ago
Attachment: | warning.txt added |
---|
comment:5 by , 13 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Hi Robert,
Replying to anonymous:
Hmmm - are you quite sure? I was sure that the default assigment was element by element rather than bit by bit.
OK - Element by element, but it might be error prone.
See boost/io/ios_state.hpp how the code looks like.
Having said that, I still get no warning in any of 200 tests. I test with MSVC 7.1 and gcc 4.3.2. That is, it still works for me.
I have MSVC 9.0.
Let me know what compiler you're using and include a small example which emits this warning.
My example is very big one - you do not want to study it. I will try to extract something.
Best regards, Seweryn.
follow-up: 8 comment:6 by , 13 years ago
This warning is included in the list of all warnings I can fix. The confusion is that I normally compile at level 3 and this warning only appears at level 4. In any case I've fixed them all in the trunk. and they will migrate to the release branch soon.
Robert Ramey
comment:7 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:8 by , 13 years ago
Hi,
In any case I've fixed them all in the trunk. and they will migrate to the release branch soon.
Thank you very much!
Best regards, Seweryn.
Patch for the problem