Archived issue #0024355

Compiler Warning level 4 for MFC samples

Open CASCADEOCCT:Samplesclosed7 public notes

Search issues

Description

All Visual Studio projects of MFC samples are required to be updated:
 1. change compiler warning level: 4 level is required
 2. fixed all warnings within projects that appeared after compiler warning level changing

Steps to reproduce

folders of projects of all versions:
<occt root>/samples/mfc/standard/<sample name>/adm/win/vc8
                                                       vc9
                                                       vc10
                                                       vc11

Public activity

7 archived notes

Participants are labeled by their role within this record.

01Commenter 1
some warnings have been removed; changes have been committed to CR24355 branch
02Commenter 2
Level 4 warnings of sample projects were fixed on VC9.
Changes are located in branch CR24355.
Please, review.
03Commenter 3
Changes in samples/mfc/standard/03_Viewer2d/src/Viewer2dDoc.cpp and samples/mfc/standard/06_Ocaf/src/OcafDoc.cpp actually disable part of functionality (reading files), please restore.

Warnings related to passing reference to temporary objects could better be eliminated by appropriate change of the parameter of the relevant methods (make reference "const"). Methods SetTitle() and SetText() in dialog classes can be complemented by variants accepting C string, this would allow passing string literals "as is", without any conversions.

Note that I pushed one more commit in this branch enabling warning lever W4 in all VS projects of MFC samples, and adding Readme on samples to OCCT docs.
04Commenter 4
>Changes in samples/mfc/standard/03_Viewer2d/src/Viewer2dDoc.cpp
>samples/mfc/standard/06_Ocaf/src/OcafDoc.cpp
my bad...

05Commenter 5
Remarks were applied.
Changes are located in branch CR24355.
Please, review.
06Commenter 6
Well done! no remarks, please test
07Commenter 2
There are no warnings in MFC samples in all versions (vc8 vc9 vc10 vc11). Samples work correctly.

Related records