MantisBT - Open CASCADE
View Issue Details
0027676Open CASCADE[OCCT] OCCT:Foundation Classespublic2016-07-14 10:432016-12-09 16:40
kgv 
bugmaster 
normalintegration request 
closedfixed 
[OCCT] 7.0.0 
[OCCT] 7.1.0[OCCT] 7.1.0 
0027676: Foundation Classes - define Standard_ExtCharacter, Standard_Utf16Char using C++11 types char16_t
Standard_TypeDef.hxx defines the following types for working with Unicode strings:
typedef short         Standard_ExtCharacter;
typedef const short*  Standard_ExtString;
typedef uint16_t      Standard_Utf16Char;    //!< UTF-16 char (always unsigned)
typedef uint32_t      Standard_Utf32Char;    //!< UTF-32 char (always unsigned)

Since OCCT requires C++11, it makes sense to redefines these types using new built-ins char16_t and char32_t.

Note that since Standard_ExtCharacter (used by TCollection_ExtendedString) has been defined as signed type (which makes no sense for working with UTF-16), this change might require extra caution.
N/A
No tags attached.
related to 0027772closed abv Foundation Classes - define Standard_Boolean using C++ type "bool" instead of "unsigned int" 
child of 0022484closed bugmaster UNICODE characters support. 
child of 0025308new pdn TCollection_ExtendedString, NCollection_String - merge classes for string management 
Issue History
2016-07-14 10:43kgvNew Issue
2016-07-14 10:43kgvAssigned To => abv
2016-07-14 10:44kgvRelationship addedchild of 0022484
2016-07-14 10:44kgvRelationship addedchild of 0025308
2016-07-30 21:57gitNote Added: 0056312
2016-07-30 21:57kgvNote Added: 0056313
2016-07-30 21:57kgvStatusnew => resolved
2016-07-31 08:48abvNote Added: 0056314
2016-07-31 08:48abvAssigned Toabv => kgv
2016-07-31 08:48abvStatusresolved => assigned
2016-07-31 10:52gitNote Added: 0056315
2016-07-31 10:53kgvNote Added: 0056316
2016-07-31 10:53kgvAssigned Tokgv => abv
2016-07-31 10:53kgvStatusassigned => resolved
2016-07-31 18:10gitNote Added: 0056322
2016-07-31 18:11abvNote Added: 0056323
2016-07-31 18:11abvAssigned Toabv => bugmaster
2016-07-31 18:11abvStatusresolved => reviewed
2016-08-02 11:27bugmasterNote Added: 0056363
2016-08-02 11:27bugmasterAssigned Tobugmaster => kgv
2016-08-02 11:27bugmasterStatusreviewed => assigned
2016-08-02 13:01gitNote Added: 0056373
2016-08-02 13:03gitNote Added: 0056374
2016-08-02 13:03kgvNote Added: 0056376
2016-08-02 13:03kgvAssigned Tokgv => bugmaster
2016-08-02 13:03kgvStatusassigned => resolved
2016-08-02 13:04kgvStatusresolved => reviewed
2016-08-03 11:18bugmasterNote Added: 0056416
2016-08-03 11:18bugmasterAssigned Tobugmaster => kgv
2016-08-03 11:18bugmasterStatusreviewed => feedback
2016-08-03 11:20bugmasterNote Edited: 0056416bug_revision_view_page.php?bugnote_id=56416#r14312
2016-08-03 13:01kgvStatusfeedback => assigned
2016-08-05 21:51gitNote Added: 0056516
2016-08-05 22:37gitNote Added: 0056520
2016-08-05 22:49gitNote Added: 0056521
2016-08-05 22:50kgvNote Added: 0056522
2016-08-05 22:50kgvAssigned Tokgv => bugmaster
2016-08-05 22:50kgvStatusassigned => resolved
2016-08-05 22:50kgvStatusresolved => reviewed
2016-08-05 22:50kgvSeverityminor => integration request
2016-08-09 11:02bugmasterNote Added: 0056584
2016-08-09 11:02bugmasterAssigned Tobugmaster => kgv
2016-08-09 11:02bugmasterStatusreviewed => feedback
2016-08-09 11:03bugmasterNote Added: 0056585
2016-08-09 14:54kgvNote Added: 0056596
2016-08-09 14:54kgvAssigned Tokgv => bugmaster
2016-08-09 14:56kgvNote Edited: 0056596bug_revision_view_page.php?bugnote_id=56596#r14380
2016-08-09 17:19bugmasterStatusfeedback => tested
2016-08-12 10:48bugmasterChangeset attached => occt master c885cfda
2016-08-12 10:48bugmasterStatustested => verified
2016-08-12 10:48bugmasterResolutionopen => fixed
2016-08-14 01:04kgvRelationship addedrelated to 0027772
2016-08-26 16:24gitNote Added: 0057157
2016-08-26 16:24gitNote Added: 0057158
2016-08-26 16:25gitNote Added: 0057172
2016-12-09 16:29aivStatusverified => closed
2016-12-09 16:40aivFixed in Version => 7.1.0

Notes
(0056312)
git   
2016-07-30 21:57   
Branch CR27676 has been created by kgv.

SHA-1: fe4ae5ec093b28525a176c913b27f740e00086a4


Detailed log of new commits:

Author: kgv
Date: Sat Jul 30 21:56:53 2016 +0300

    0027676: Foundation Classes - define Standard_ExtCharacter, Standard_Utf16Char using C++11 types char16_t
(0056313)
kgv   
2016-07-30 21:57   
Patch is ready for review.
(0056314)
abv   
2016-07-31 08:48   
I believe we need to keep possibility of building OCCT with compilers not supporting char16_t and char32_t. Note that GCC supports these types only since 4.4 (see https://gcc.gnu.org/projects/cxx-status.html#cxx11 [^] N2249), while we declare support of GCC 4.3 (https://dev.opencascade.org/doc/overview/html/index.html#overview_req_cpp [^]).

Naturally we can elevate this requirement to GCC 4.4, however we must be ready to turn back to this point if this support is required. At least, we need to cross-check with SALOME team what minimal version of GCC they will support in coming version (likely corresponding to the minimal default GCC version on supported OS), to be sure that it is at least 4.4.
(0056315)
git   
2016-07-31 10:52   
Branch CR27676 has been updated forcibly by kgv.

SHA-1: 68c201e07e2d42c09d8db06ea4a9c3fd8c1020c1
(0056316)
kgv   
2016-07-31 10:53   
Fall-back code for gcc 4.3 has been added.
(0056322)
git   
2016-07-31 18:10   
Branch CR27676 has been updated by abv.

SHA-1: 2df61b73cb37acf8d96dd43ffdfa99f53efc6758


Detailed log of new commits:

Author: abv
Date: Sun Jul 31 18:08:20 2016 +0300

    // minor correction

(0056323)
abv   
2016-07-31 18:11   
Reviewed with minor correction; please test
(0056363)
bugmaster   
2016-08-02 11:27   
Rejected due to a lot of compilation error :

Linux - all platforms
Windows - VC 2015

http://jenkins-test-08.nnov.opencascade.com/view/CR27676/view/OCCT%20compile/ [^]
(0056373)
git   
2016-08-02 13:01   
Branch CR27676 has been updated by kgv.

SHA-1: 66f93e75bf6c76a49b652051782de4fd51932115


Detailed log of new commits:

Author: kgv
Date: Tue Aug 2 13:03:02 2016 +0300

    update DDF_IOStream as copy-paste from FSD_File

(0056374)
git   
2016-08-02 13:03   
Branch CR27676_1 has been created by kgv.

SHA-1: d04b407a070aa1e8b32d442e688bcc0f095b5d61


Detailed log of new commits:

Author: kgv
Date: Tue Aug 2 13:04:25 2016 +0300

    0027676: Foundation Classes - define Standard_ExtCharacter, Standard_Utf16Char using C++11 types char16_t
(0056376)
kgv   
2016-08-02 13:03   
Please test updated patch in branch CR27676_1.
(0056416)
bugmaster   
2016-08-03 11:18   
(edited on: 2016-08-03 11:20)
Branch CR27676_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: d04b407a070aa1e8b32d442e688bcc0f095b5d61

Number of compiler warnings:
Not new warning on all platforms

Regressions/Differences:

OCCT products (both Windows and Linux) :
parasolid read bug26983_1 bug26983_2 bug26983_3
http://occt-tests/CR27676_1_master-Products/Debian70-64/summary.html [^]
http://occt-tests/CR27676_1_master-Products/Windows-64-VC10/summary.html [^]

OCCT samples is not compiled:
OCCT MFC sample (on all windows compilers) and csharp (on VC 2015)
http://jenkins-test-08.nnov.opencascade.com/view/CR27676_1/view/SAMPLE%20compile/ [^]

Thera are no difference in images, cpu amd memory

Testing cases:
Not needed

Testing on Linux:
OCCT
Total MEMORY difference: 29936154 / 29874969 [+0.20%]
Total CPU difference: 4983.969999999978 / 4972.089999999973 [+0.24%]
Products
Total MEMORY difference: 90730448 / 90119548 [+0.68%]
Total CPU difference: 19406.08 / 19470.060000000092 [-0.33%]


Testing on Windows:
OCCT
Total MEMORY difference: 57076470 / 57093912 [-0.03%]
Total CPU difference: 18005.276617698866 / 18078.831089198848 [-0.41%]
Products:
Total MEMORY difference: 21058229 / 21230358 [-0.81%]
Total CPU difference: 4761.166120099945 / 4893.65776939995 [-2.71%]

(0056516)
git   
2016-08-05 21:51   
Branch CR27676_1 has been updated forcibly by kgv.

SHA-1: 4337c211732299692144391a8eca6fccaa492891
(0056520)
git   
2016-08-05 22:37   
Branch CR27676_1 has been updated by kgv.

SHA-1: ea234952b19cb5570fa8c2024bee5d3b80116fd4


Detailed log of new commits:

Author: kgv
Date: Fri Aug 5 22:37:37 2016 +0300

    Update MFC samples

(0056521)
git   
2016-08-05 22:49   
Branch CR27676_2 has been created by kgv.

SHA-1: 77604436a0d0878d094361685c8e23071b213da1


Detailed log of new commits:

Author: kgv
Date: Fri Aug 5 22:49:11 2016 +0300

    0027676: Foundation Classes - define Standard_ExtCharacter, Standard_Utf16Char using C++11 types char16_t
(0056522)
kgv   
2016-08-05 22:50   
Please test CR27676_2 (occt and Products).
(0056584)
bugmaster   
2016-08-09 11:02   
Branch CR27676_2 from occt git-repository and products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 77604436a0d0878d094361685c8e23071b213da1

http://jenkins-test-08.nnov.opencascade.com:8080/view/CR27676_2/ [^]

Number of compiler warnings:
Not
Regressions/Differences:
Not

OCCT samples are not compiled:
OCCT mfc sample (Products) and csharp (OCCT) on VC 2015
http://jenkins-test-08.nnov.opencascade.com:8080/view/CR27676_2/view/SAMPLES/job/CR27676_2_CR27676_2-OCCT-Windows-64-VC14-sample-csharp/3/parsed_console/ [^]
http://jenkins-test-08.nnov.opencascade.com:8080/view/CR27676_2/view/SAMPLES/job/CR27676_2_CR27676_2-Products-Windows-64-VC14-sample-mfc/3/parsed_console/ [^]

Not difference in images, cpu amd memory

Testing cases:
Not needed

Testing on Linux:
OCCT
Total MEMORY difference: 88871617 / 88452773 [+0.47%]
Total CPU difference: 19715.700000000183 / 19249.11000000006 [+2.42%]
Products
Total MEMORY difference: 30036679 / 30023278 [+0.04%]
Total CPU difference: 5091.67999999998 / 5098.489999999977 [-0.13%]


Testing on Windows:
OCCT
Total MEMORY difference: 57142331 / 57173794 [-0.06%]
Total CPU difference: 18010.48705109892 / 18044.994472298804 [-0.19%]
Products:
Total MEMORY difference: 21232872 / 21236271 [-0.02%]
Total CPU difference: 4820.196898499945 / 4792.459920699942 [+0.58%]
(0056585)
bugmaster   
2016-08-09 11:03   
Branch CR27676_2 has been rejected because:
Several samples is not compiled
(0056596)
kgv   
2016-08-09 14:54   
(edited on: 2016-08-09 14:56)
Dear Bugmaster,

the issue is not with the patch but with building procedures.
These samples are build with inconsistent version of Visual Studio
(OCCT is built with VS2015 while samples are built with VS2010).

This is not caused by this patch, but it was remain hidden.
Within the patch, OCCT now uses char16_t/char32_t which are now built-in types since VS2015 (following C++11 specifications), while in earlier VS versions they were typedefed.
Thus, building OCCT and samples with inconsistent VS versions now leads to linkage errors.

See building script windows_sample_compile.bat:
  devenv.exe %%a.%VCVER%.sln /rebuild "%optkey%|%CBMODE%" /out %WORKSPACE%/Log.txt

devenv.exe is called without full path (in contrast to msvc.bat from OCCT generated by genproj.tcl).
In such case Visual Studio detects which version of Visual Studio to launch depending on header of opened solution file.
And /upgrade is not called for these specific samples.

In first case (C# sample in OCCT), CSharp.sln is a VS2010 solution file.

In second case (MFC samples in Products), XDE.vc14.sln and others are VS2015 solution files BUT they refer to VS2010 project file (XDE.vcxproj and others).
Without upgrade option, the second scenario opens VS2015 but uses C++ toolchain from VS2010 inconsistent with OCCT.

Note that ideally it is possible defining single .vcxproj file supporting multiple C++ toolchain version at once, since VS2010/2012/2013/2015 use the same format with minor extensions (depending on Visual Studio opening the project), e.g. using DefaultPlatformToolset (note that this variable is NOT defined in VS2010):
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>

however such improvement should be considered in dedicated issue.

(0057157)
git   
2016-08-26 16:24   
Branch CR27676_2 has been deleted by inv.

SHA-1: 77604436a0d0878d094361685c8e23071b213da1
(0057158)
git   
2016-08-26 16:24   
Branch CR27676_1 has been deleted by inv.

SHA-1: ea234952b19cb5570fa8c2024bee5d3b80116fd4
(0057172)
git   
2016-08-26 16:25   
Branch CR27676 has been deleted by inv.

SHA-1: 66f93e75bf6c76a49b652051782de4fd51932115