View Issue Details

IDProjectCategoryView StatusLast Update
0026669Open CASCADEOCCT:Codingpublic2016-04-20 15:48
ReporterskiAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.0.0Fixed in Version7.0.0 
Summary0026669: Eliminate compile warnings obtained by building occt with vc14: 'type cast': conversion from 'BOOL' to 'WNDPROC' of greater size
DescriptionNext warnings appears during occt compilation with vc14:

..\src\Draw\init.cxx(79): warning C4312: 'type cast': conversion from 'BOOL' to 'WNDPROC' of greater size
Steps To ReproduceTry to compile occt with vc14 (Visual Studio 2015)
TagsNo tags attached.
Test case numberNot needed

Activities

git

2015-09-29 20:09

administrator   ~0046297

Branch CR26669 has been created by rkv.

SHA-1: ed43af8ab9148e03f153cdee8e82f7174f635ad4


Detailed log of new commits:

Author: rkv
Date: Tue Sep 29 20:09:15 2015 +0300

    0026669: Eliminate compile warnings obtained by building occt with vc14: 'type cast': conversion from 'BOOL' to 'WNDPROC' of greater size

kgv

2015-09-29 20:27

developer   ~0046298

-  wndClass.lpfnWndProc   = (WNDPROC)CommandProc((HWND)WndProc,(WPARAM)342,(LPARAM)443);
+  wndClass.lpfnWndProc   = (WNDPROC)(LONG_PTR)CommandProc((HWND)WndProc,(WPARAM)342,(LPARAM)443);
   //wndClass.lpfnWndProc   = (WNDPROC)CommandProc;

the patch makes absolutely no sense - it just suppresses warning pointing onto broken code.

And please correct git settings on your workstation.

kgv

2015-09-29 20:42

developer   ~0046299

Last edited: 2015-09-29 20:42

> Thu Sep 22 21:55:24 2005
> Porting on Windows 64-bit cxx only:
-   wndClass.lpfnWndProc   = CommandProc;
+   wndClass.lpfnWndProc   = (WNDPROC)CommandProc((HWND)WndProc,(WPARAM)342,(LPARAM)443);
+   //wndClass.lpfnWndProc   = (WNDPROC)CommandProc;

these code lines have been initially introduced within the patch for porting onto 64-bit Windows, and look like a temporary testing code.

git

2015-10-01 16:16

administrator   ~0046378

Branch CR26669 has been updated by rkv.

SHA-1: 9ebad74ba6dd83d6058e3b49643f24d86c5daabe


Detailed log of new commits:

Author: rkv
Date: Thu Oct 1 16:16:23 2015 +0300

    Signature of the command window callback has been fixed to avoid unnecessary type casting. It is used when Draw_IsConsoleSubsystem = Standard_False
     i.e. in non-console mode (see _main_() in Draw_Main.cxx).

git

2015-10-01 16:19

administrator   ~0046379

Branch CR26669 has been updated forcibly by rkv.

SHA-1: 784a7f040dd06cfcfc3062a84c8c0bda807db6b4

rkv

2015-10-01 16:28

developer   ~0046380

The fixed callback is not used in usual DRAW working mode (with console). It is supposed to be used for MDI mode. To test the changes I had to set Draw_IsConsoleSubsystem = Standard_False in _main_() in Draw_Main.cxx

There is only one case when it could be activated in usual mode - in Run_Appli() in Draw_Window.cxx if there is a problem with thread creation:

  if (Draw_IsConsoleSubsystem) {
    hThread = CreateThread(NULL, // no security attributes
...
    if (!hThread) {
      cout << "pb in creation of the thread reading stdin" << endl;
      Draw_IsConsoleSubsystem = Standard_False;
      Init_Appli(GetModuleHandle(NULL),
                 GetModuleHandle(NULL),
                 1, hWnd); // reinit => create MDI client wnd
    }

However it is not clear how to reproduce it.

kgv

2015-10-05 12:05

developer   ~0046443

Please test the patch.

-      CommandProc(hWndFrame, wParam, lParam);
+      CmdProc(hWndFrame, LOWORD(wParam), wParam, lParam);

note that this technically incorrect - window procedures should be called only using auxiliary function CallWindowProc(). However this does not matter in this context.

git

2015-10-05 13:12

administrator   ~0046448

Branch CR26669 has been updated forcibly by mkv.

SHA-1: 1838553394a067a86fb2ce223a117355d77c65f4

mkv

2015-10-06 15:18

tester   ~0046516

Dear BugMaster,
Branch CR26669 was rebased on current master of occt git-repository.
SHA-1: 1838553394a067a86fb2ce223a117355d77c65f4

mkv

2015-10-06 15:18

tester   ~0046517

Dear BugMaster,
Branch CR26669 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 1838553394a067a86fb2ce223a117355d77c65f4

Number of compiler warnings:

occt component :
Linux: 13 (13 on master)
Windows: 4 (0 on master)

products component :
Linux: 39 (39 on master)
Windows: 0 (0 on master)

There is new additional compilation warning on Windows platform:
http://jenkins-test-01.nnov.opencascade.com:8080/user/mnt/my-views/view/A_mnt_warnings/portlet/dashboard_portlet_17008/job/CR26669-master_build_occt_windows_64/1/warnings34Result/
MainWindow.cxx:91, MSBuild, Priority: Normal
'wParam' : unreferenced formal parameter
MainWindow.cxx:91, MSBuild, Priority: Normal
'lParam' : unreferenced formal parameter

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 92502279 / 92365865 [+0.15%]
Total CPU difference: 19797.799999999766 / 19809.56999999982 [-0.06%]
products component :
Total MEMORY difference: 26330169 / 26369733 [-0.15%]
Total CPU difference: 7256.990000000004 / 7378.749999999995 [-1.65%]

Testing on Windows:
occt component :
Total MEMORY difference: 58069681 / 58089039 [-0.03%]
Total CPU difference: 18258.23223919938 / 18228.68564979895 [+0.16%]
products component :
Total MEMORY difference: 17178481 / 17183716 [-0.03%]
Total CPU difference: 5667.141927599961 / 5689.09126829997 [-0.39%]

There are no differences in images found by testdiff.

mkv

2015-10-06 15:19

tester   ~0046518

Dear rkv,
Branch CR26669 has been rejected due to:
- additional warnings

git

2015-10-06 16:44

administrator   ~0046526

Branch CR26669 has been updated forcibly by rkv.

SHA-1: 8d92a8b2a0f010b1c94a7e1de7d1e42e78ce91cf

kgv

2015-10-06 16:48

developer   ~0046529

Dear rkv,

0026669: Eliminate compile warnings obtained by building occt with vc14: 'type cast': conversion from 'BOOL' to 'WNDPROC' of greater size

please update commit description following bug workflow rules.

git

2015-10-07 09:57

administrator   ~0046540

Branch CR26669 has been updated forcibly by rkv.

SHA-1: ff01fb07ebb4b69c40662c359ecc8294467c883a

kgv

2015-10-07 10:09

developer   ~0046542

Please test the patch.

mkv

2015-10-09 21:11

tester   ~0046653

Dear BugMaster,
Branch CR26669 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: ff01fb07ebb4b69c40662c359ecc8294467c883a

Number of compiler warnings:

occt component :
Linux: 13 (13 on master)
Windows: 0 (0 on master)

products component :
Linux: 39 (39 on master)
Windows: 0 (0 on master)

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 92619586 / 92366914 [+0.27%]
Total CPU difference: 19849.979999999796 / 19809.65999999982 [+0.20%]
products component :
Total MEMORY difference: 26321887 / 26369733 [-0.18%]
Total CPU difference: 7421.169999999992 / 7378.749999999995 [+0.57%]

Testing on Windows:
occt component :
Total MEMORY difference: 58080467 / 58089039 [-0.01%]
Total CPU difference: 19091.589581198663 / 18228.68564979895 [+4.73%]
products component :
Total MEMORY difference: 17178479 / 17183716 [-0.03%]
Total CPU difference: 5829.382967599973 / 5689.09126829997 [+2.47%]

There are no differences in images found by testdiff.

mkv

2015-10-09 21:12

tester   ~0046654

Dear BugMaster,
Branch CR26669 is TESTED.

git

2015-10-16 16:28

administrator   ~0046952

Branch CR26669 has been deleted by kgv.

SHA-1: ff01fb07ebb4b69c40662c359ecc8294467c883a

Related Changesets

occt: master 839b8d3c

2015-10-06 13:43:47

rkv


Committer: bugmaster Details Diff
0026669: Eliminate compile warnings obtained by building occt with vc14: 'type cast': conversion from 'BOOL' to 'WNDPROC' of greater size

Signature of the command window callback has been fixed to avoid unnecessary type casting. It is used when Draw_IsConsoleSubsystem = Standard_False
i.e. in non-console mode (see _main_() in Draw_Main.cxx).
Affected Issues
0026669
mod - src/Draw/init.cxx Diff File
mod - src/Draw/MainWindow.cxx Diff File
mod - src/Draw/MAINWINDOW.h Diff File

Issue History

Date Modified Username Field Change
2015-09-09 13:03 ski New Issue
2015-09-09 13:03 ski Assigned To => ski
2015-09-09 14:21 ski Assigned To ski => abv
2015-09-21 07:03 abv Assigned To abv => rkv
2015-09-21 07:03 abv Status new => assigned
2015-09-29 20:09 git Note Added: 0046297
2015-09-29 20:10 rkv Assigned To rkv => kgv
2015-09-29 20:10 rkv Status assigned => resolved
2015-09-29 20:10 rkv Assigned To kgv => abv
2015-09-29 20:27 kgv Note Added: 0046298
2015-09-29 20:27 kgv Assigned To abv => rkv
2015-09-29 20:27 kgv Status resolved => assigned
2015-09-29 20:42 kgv Note Added: 0046299
2015-09-29 20:42 kgv Note Edited: 0046299
2015-09-29 20:42 kgv Note Edited: 0046299
2015-10-01 16:16 git Note Added: 0046378
2015-10-01 16:19 git Note Added: 0046379
2015-10-01 16:28 rkv Note Added: 0046380
2015-10-01 16:29 rkv Assigned To rkv => kgv
2015-10-01 16:29 rkv Status assigned => resolved
2015-10-05 12:05 kgv Note Added: 0046443
2015-10-05 12:05 kgv Assigned To kgv => bugmaster
2015-10-05 12:05 kgv Status resolved => reviewed
2015-10-05 13:12 git Note Added: 0046448
2015-10-05 13:25 mkv Assigned To bugmaster => mkv
2015-10-06 15:18 mkv Note Added: 0046516
2015-10-06 15:18 mkv Note Added: 0046517
2015-10-06 15:19 mkv Note Added: 0046518
2015-10-06 15:19 mkv Assigned To mkv => rkv
2015-10-06 15:19 mkv Status reviewed => assigned
2015-10-06 15:19 mkv Test case number => Not needed
2015-10-06 16:44 git Note Added: 0046526
2015-10-06 16:44 rkv Assigned To rkv => kgv
2015-10-06 16:44 rkv Status assigned => resolved
2015-10-06 16:48 kgv Note Added: 0046529
2015-10-06 16:50 kgv Assigned To kgv => rkv
2015-10-06 16:50 kgv Status resolved => assigned
2015-10-07 09:57 git Note Added: 0046540
2015-10-07 09:57 rkv Assigned To rkv => kgv
2015-10-07 09:57 rkv Status assigned => resolved
2015-10-07 10:09 kgv Note Added: 0046542
2015-10-07 10:09 kgv Assigned To kgv => bugmaster
2015-10-07 10:09 kgv Status resolved => reviewed
2015-10-07 13:03 mkv Assigned To bugmaster => mkv
2015-10-09 21:11 mkv Note Added: 0046653
2015-10-09 21:12 mkv Note Added: 0046654
2015-10-09 21:12 mkv Assigned To mkv => bugmaster
2015-10-09 21:12 mkv Status reviewed => tested
2015-10-16 13:18 bugmaster Changeset attached => occt master 839b8d3c
2015-10-16 13:18 bugmaster Status tested => verified
2015-10-16 13:18 bugmaster Resolution open => fixed
2015-10-16 16:28 git Note Added: 0046952
2016-04-20 15:44 aiv Fixed in Version => 7.0.0
2016-04-20 15:48 aiv Status verified => closed