New C2220: warning treated as error (MSVC 2015 build failure)

classic Classic list List threaded Threaded
7 messages Options
slacka slacka
Reply | Threaded
Open this post in threaded view
|

New C2220: warning treated as error (MSVC 2015 build failure)

Ever since https://cgit.freedesktop.org/libreoffice/core/commit/?id=62c047ffb397802c09df9070492e70725928cadf

Author: Markus Mohrhard <[hidden email]>
Date:   Mon Jun 20 09:02:47 2016 +0200

    switch to EHs on windows

I'm getting the following build error with MSVC 2015 (32-bit MSVC 2013 still works). 

[build CXX] svl/source/undo/undo.cxx
c:\lode\dev\core\svl\source\undo\undo.cxx(390) : error C2220: warning treated as error - no 'object' file generated
c:\lode\dev\core\svl\source\undo\undo.cxx(390) : warning C4702: unreachable code
C:/lode/dev/core/solenv/gbuild/LinkTarget.mk:189: recipe for target 'C:/lode/dev/core/workdir/CxxObject/svl/source/undo/undo.o' failed
make[1]: *** [C:/lode/dev/core/workdir/CxxObject/svl/source/undo/undo.o] Error 2
make[1]: *** Waiting for unfinished jobs....
Makefile:258: recipe for target 'build' failed
make: *** [build] Error 2

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Markus Mohrhard Markus Mohrhard
Reply | Threaded
Open this post in threaded view
|

Re: New C2220: warning treated as error (MSVC 2015 build failure)

Hey Luke,

On Thu, Jun 30, 2016 at 7:46 PM, Luke Benes <[hidden email]> wrote:
Ever since https://cgit.freedesktop.org/libreoffice/core/commit/?id=62c047ffb397802c09df9070492e70725928cadf

Author: Markus Mohrhard <[hidden email]>
Date:   Mon Jun 20 09:02:47 2016 +0200

    switch to EHs on windows

I'm getting the following build error with MSVC 2015 (32-bit MSVC 2013 still works). 

[build CXX] svl/source/undo/undo.cxx
c:\lode\dev\core\svl\source\undo\undo.cxx(390) : error C2220: warning treated as error - no 'object' file generated
c:\lode\dev\core\svl\source\undo\undo.cxx(390) : warning C4702: unreachable code
C:/lode/dev/core/solenv/gbuild/LinkTarget.mk:189: recipe for target 'C:/lode/dev/core/workdir/CxxObject/svl/source/undo/undo.o' failed
make[1]: *** [C:/lode/dev/core/workdir/CxxObject/svl/source/undo/undo.o] Error 2
make[1]: *** Waiting for unfinished jobs....
Makefile:258: recipe for target 'build' failed
make: *** [build] Error 2


Most likely you need to remove the try .. catch block. As currently nobody is really using MSVC 2015 we are not going to see these issues. So if you plan to compile with MSVC 2015 you must fix most of them yourself until we finally switch.

I have currently no MSVC 2015 to see if removing the try catch block is the right fix.

Regards,
Markus

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: New C2220: warning treated as error (MSVC 2015 build failure)

On 06/30/2016 10:47 PM, Markus Mohrhard wrote:

> On Thu, Jun 30, 2016 at 7:46 PM, Luke Benes <[hidden email]
> <mailto:[hidden email]>> wrote:
>     Ever
>     since https://cgit.freedesktop.org/libreoffice/core/commit/?id=62c047ffb397802c09df9070492e70725928cadf
>
>     Author: Markus Mohrhard <[hidden email]
>     <mailto:[hidden email]>>
>     Date:   Mon Jun 20 09:02:47 2016 +0200
>
>         switch to EHs on windows
>
>     I'm getting the following build error with MSVC 2015 (32-bit MSVC
>     2013 still works).
>
>     [build CXX] svl/source/undo/undo.cxx
>     c:\lode\dev\core\svl\source\undo\undo.cxx(390) : error C2220:
>     warning treated as error - no 'object' file generated
>     c:\lode\dev\core\svl\source\undo\undo.cxx(390) : warning C4702:
>     unreachable code
>     C:/lode/dev/core/solenv/gbuild/LinkTarget.mk:189: recipe for target
>     'C:/lode/dev/core/workdir/CxxObject/svl/source/undo/undo.o' failed
>     make[1]: ***
>     [C:/lode/dev/core/workdir/CxxObject/svl/source/undo/undo.o] Error 2
>     make[1]: *** Waiting for unfinished jobs....
>     Makefile:258: recipe for target 'build' failed
>     make: *** [build] Error 2
>
> Most likely you need to remove the try .. catch block. As currently
> nobody is really using MSVC 2015 we are not going to see these issues.
> So if you plan to compile with MSVC 2015 you must fix most of them
> yourself until we finally switch.

The relevant code in svl/source/undo/undo.cxx

>         // delete all actions
>         while ( !m_aUndoActionsCleanup.empty() )
>         {
>             SfxUndoAction* pAction = m_aUndoActionsCleanup.front();
>             m_aUndoActionsCleanup.pop_front();
>             try
>             {
>                 delete pAction;
>             }
>             catch( const Exception& )
>             {
>                 DBG_UNHANDLED_EXCEPTION();
>             }
>         }

is interesting.  Since C++11, the destructor of the (abstract base)
class SfxUndoAction is implicitly noexcept(true), so the catch block
clearly cannot be reached.

However, from this code alone it is unclear whether some class derived
from SfxUndoAction actually wants to throw exceptions during destruction
(so all the relevant class's destructors---which would include
SfxUndoAction as well as any other bases or non-static data members of
the derived class that actually want to throw exceptions---would need to
be explicitly marked as noexcept(true); even though the act of throwing
exceptions from a destructor is of course rather poor design), or
whether this catch block has always been redundant (and should probably
have been left out from the start).
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
slacka slacka
Reply | Threaded
Open this post in threaded view
|

Re: New C2220: warning treated as error (MSVC 2015 build failure)

After Michael Stahl's commit,

https://cgit.freedesktop.org/libreoffice/core/commit/?id=59e4bd07211d8509dcb3e89f6645c0ba3085df23

MSVC 2015 can successfully build master again.  Thanks everyone!
slacka slacka
Reply | Threaded
Open this post in threaded view
|

Re: New MSVC 2015 build failure

In reply to this post by slacka
Before 

I was able to successfully compile with MSVC 2015, but now I'm getting:

C:/core/chart2/source/controller/uitest/uiobject.cxx(149): error C2039: 'inserter': is not a member of 'std'
C:/PROGRA~2/MICROS~1.0/VC//include\unordered_set(13): note: see declaration of 'std'
C:/core/chart2/source/controller/uitest/uiobject.cxx(149): error C3861: 'inserter': identifier not found
C:/core/solenv/gbuild/LinkTarget.mk:189: recipe for target 'C:/core/workdir/CxxObject/chart2/source/controller/uitest/uiobject.o' failed
make[1]: *** [C:/core/workdir/CxxObject/chart2/source/controller/uitest/uiobject.o] Error 2
make[1]: *** Waiting for unfinished jobs....
Makefile:262: recipe for target 'build' failed
make: *** [build] Error 2

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Michael Stahl-2 Michael Stahl-2
Reply | Threaded
Open this post in threaded view
|

Re: New MSVC 2015 build failure

On 22.07.2016 19:07, Luke Benes wrote:

> Before
> https://cgit.freedesktop.org/libreoffice/core/commit/?id=0f03a801318501a4904dbe7c1d09d0b9dd1cb852
>
> I was able to successfully compile with MSVC 2015, but now I'm getting:
>
> C:/core/chart2/source/controller/uitest/uiobject.cxx(149): error C2039:
> 'inserter': is not a member of 'std'
> C:/PROGRA~2/MICROS~1.0/VC//include\unordered_set(13): note: see
> declaration of 'std'
> C:/core/chart2/source/controller/uitest/uiobject.cxx(149): error C3861:
> 'inserter': identifier not found

hope it's fixed now by commit
580ed47cf7dd56850b3a6868f7ab1fbbdc9b3e98

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
slacka slacka
Reply | Threaded
Open this post in threaded view
|

Re: New MSVC 2015 build failure

Yes, that fixed it. Thanks  Michael!

Now the only hold up with MSVC 2015 is the C4702: unreachable code Error.

http://nabble.documentfoundation.org/C2220-warning-treated-as-error-64-bit-MSVC-2015-td4184053.html#a4189120