Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3589 closed Bugs (fixed)

Compiler could not create assigment operator

Reported by: Seweryn Habdank-Wojewodzki <seweryn@…> Owned by: Robert Ramey
Milestone: Component: serialization
Version: Boost Development Trunk Severity: Cosmetic
Keywords: Cc:

Description

Flood of warnings for that issue.

Attachments (2)

serialization_array.hpp.patch (375 bytes ) - added by Seweryn Habdank-Wojewodzki <seweryn@…> 13 years ago.
Patch for the problem
warning.txt (7.8 KB ) - added by rwebb <richard.webb@…> 13 years ago.

Download all attachments as: .zip

Change History (10)

by Seweryn Habdank-Wojewodzki <seweryn@…>, 13 years ago

Patch for the problem

comment:1 by Robert Ramey, 13 years ago

Resolution: worksforme
Status: newclosed

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 Seweryn Habdank-Wojewodzki <seweryn@…>, 13 years ago

Resolution: worksforme
Status: closedreopened

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.

comment:3 by anonymous, 13 years ago

Resolution: worksforme
Status: reopenedclosed

"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 rwebb <richard.webb@…>, 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 rwebb <richard.webb@…>, 13 years ago

Attachment: warning.txt added

in reply to:  3 comment:5 by Seweryn Habdank-Wojewodzki <seweryn@…>, 13 years ago

Resolution: worksforme
Status: closedreopened

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.

comment:6 by Robert Ramey, 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 Robert Ramey, 13 years ago

Resolution: fixed
Status: reopenedclosed

in reply to:  6 comment:8 by Seweryn Habdank-Wojewodzki <seweryn@…>, 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.

Note: See TracTickets for help on using tickets.