View Issue Details

IDProjectCategoryView StatusLast Update
0027676Open CASCADEOCCT:Foundation Classespublic2020-11-18 14:59
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityintegration request 
Status closedResolutionfixed 
Product Version7.0.0 
Target Version7.1.0Fixed in Version7.1.0 
Summary0027676: Foundation Classes - define Standard_ExtCharacter, Standard_Utf16Char using C++11 types char16_t
DescriptionStandard_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.
Steps To ReproduceN/A
TagsNo tags attached.
Test case number

Relationships

parent of 0031940 closedbugmaster Community Foundation Classes - TCollection_ExtendedString::Print() corrupts UNICODE strings and does not compile with C++20 
related to 0027772 closedabv Open CASCADE Foundation Classes - define Standard_Boolean using C++ type "bool" instead of "unsigned int" 
child of 0022484 closedbugmaster Open CASCADE UNICODE characters support. 
child of 0025308 newszy Open CASCADE TCollection_ExtendedString, NCollection_String - merge classes for string management 

Activities

git

2016-07-30 21:57

administrator   ~0056312

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

kgv

2016-07-30 21:57

developer   ~0056313

Patch is ready for review.

abv

2016-07-31 08:48

manager   ~0056314

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.

git

2016-07-31 10:52

administrator   ~0056315

Branch CR27676 has been updated forcibly by kgv.

SHA-1: 68c201e07e2d42c09d8db06ea4a9c3fd8c1020c1

kgv

2016-07-31 10:53

developer   ~0056316

Fall-back code for gcc 4.3 has been added.

git

2016-07-31 18:10

administrator   ~0056322

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

abv

2016-07-31 18:11

manager   ~0056323

Reviewed with minor correction; please test

bugmaster

2016-08-02 11:27

administrator   ~0056363

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/

git

2016-08-02 13:01

administrator   ~0056373

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

git

2016-08-02 13:03

administrator   ~0056374

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

kgv

2016-08-02 13:03

developer   ~0056376

Please test updated patch in branch CR27676_1.

bugmaster

2016-08-03 11:18

administrator   ~0056416

Last edited: 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%]

git

2016-08-05 21:51

administrator   ~0056516

Branch CR27676_1 has been updated forcibly by kgv.

SHA-1: 4337c211732299692144391a8eca6fccaa492891

git

2016-08-05 22:37

administrator   ~0056520

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

git

2016-08-05 22:49

administrator   ~0056521

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

kgv

2016-08-05 22:50

developer   ~0056522

Please test CR27676_2 (occt and Products).

bugmaster

2016-08-09 11:02

administrator   ~0056584

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%]

bugmaster

2016-08-09 11:03

administrator   ~0056585

Branch CR27676_2 has been rejected because:
Several samples is not compiled

kgv

2016-08-09 14:54

developer   ~0056596

Last edited: 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.

git

2016-08-26 16:24

administrator   ~0057157

Branch CR27676_2 has been deleted by inv.

SHA-1: 77604436a0d0878d094361685c8e23071b213da1

git

2016-08-26 16:24

administrator   ~0057158

Branch CR27676_1 has been deleted by inv.

SHA-1: ea234952b19cb5570fa8c2024bee5d3b80116fd4

git

2016-08-26 16:25

administrator   ~0057172

Branch CR27676 has been deleted by inv.

SHA-1: 66f93e75bf6c76a49b652051782de4fd51932115

Related Changesets

occt: master c885cfda

2016-08-05 19:49:11

kgv


Committer: bugmaster Details Diff
0027676: Foundation Classes - define Standard_ExtCharacter, Standard_Utf16Char using C++11 types char16_t Affected Issues
0027676
mod - dox/dev_guides/upgrade/upgrade.md Diff File
mod - samples/mfc/occtdemo/Common/WNT/OCCDemoDoc.cpp Diff File
mod - samples/mfc/standard/08_HLR/src/SelectionDialog.cpp Diff File
mod - samples/mfc/standard/10_Convert/src/WNT/OCCDemoDoc.cpp Diff File
mod - src/DDF/DDF_IOStream.cxx Diff File
mod - src/FSD/FSD_CmpFile.cxx Diff File
mod - src/FSD/FSD_File.cxx Diff File
mod - src/Standard/Standard.cxx Diff File
mod - src/Standard/Standard_TypeDef.hxx Diff File
mod - src/TCollection/TCollection_ExtendedString.cxx Diff File

Issue History

Date Modified Username Field Change
2016-07-14 10:43 kgv New Issue
2016-07-14 10:43 kgv Assigned To => abv
2016-07-14 10:44 kgv Relationship added child of 0022484
2016-07-14 10:44 kgv Relationship added child of 0025308
2016-07-30 21:57 git Note Added: 0056312
2016-07-30 21:57 kgv Note Added: 0056313
2016-07-30 21:57 kgv Status new => resolved
2016-07-31 08:48 abv Note Added: 0056314
2016-07-31 08:48 abv Assigned To abv => kgv
2016-07-31 08:48 abv Status resolved => assigned
2016-07-31 10:52 git Note Added: 0056315
2016-07-31 10:53 kgv Note Added: 0056316
2016-07-31 10:53 kgv Assigned To kgv => abv
2016-07-31 10:53 kgv Status assigned => resolved
2016-07-31 18:10 git Note Added: 0056322
2016-07-31 18:11 abv Note Added: 0056323
2016-07-31 18:11 abv Assigned To abv => bugmaster
2016-07-31 18:11 abv Status resolved => reviewed
2016-08-02 11:27 bugmaster Note Added: 0056363
2016-08-02 11:27 bugmaster Assigned To bugmaster => kgv
2016-08-02 11:27 bugmaster Status reviewed => assigned
2016-08-02 13:01 git Note Added: 0056373
2016-08-02 13:03 git Note Added: 0056374
2016-08-02 13:03 kgv Note Added: 0056376
2016-08-02 13:03 kgv Assigned To kgv => bugmaster
2016-08-02 13:03 kgv Status assigned => resolved
2016-08-02 13:04 kgv Status resolved => reviewed
2016-08-03 11:18 bugmaster Note Added: 0056416
2016-08-03 11:18 bugmaster Assigned To bugmaster => kgv
2016-08-03 11:18 bugmaster Status reviewed => feedback
2016-08-03 11:20 bugmaster Note Edited: 0056416
2016-08-03 13:01 kgv Status feedback => assigned
2016-08-05 21:51 git Note Added: 0056516
2016-08-05 22:37 git Note Added: 0056520
2016-08-05 22:49 git Note Added: 0056521
2016-08-05 22:50 kgv Note Added: 0056522
2016-08-05 22:50 kgv Assigned To kgv => bugmaster
2016-08-05 22:50 kgv Status assigned => resolved
2016-08-05 22:50 kgv Status resolved => reviewed
2016-08-05 22:50 kgv Severity minor => integration request
2016-08-09 11:02 bugmaster Note Added: 0056584
2016-08-09 11:02 bugmaster Assigned To bugmaster => kgv
2016-08-09 11:02 bugmaster Status reviewed => feedback
2016-08-09 11:03 bugmaster Note Added: 0056585
2016-08-09 14:54 kgv Note Added: 0056596
2016-08-09 14:54 kgv Assigned To kgv => bugmaster
2016-08-09 14:56 kgv Note Edited: 0056596
2016-08-09 17:19 bugmaster Status feedback => tested
2016-08-12 10:48 bugmaster Changeset attached => occt master c885cfda
2016-08-12 10:48 bugmaster Status tested => verified
2016-08-12 10:48 bugmaster Resolution open => fixed
2016-08-14 01:04 kgv Relationship added related to 0027772
2016-08-26 16:24 git Note Added: 0057157
2016-08-26 16:24 git Note Added: 0057158
2016-08-26 16:25 git Note Added: 0057172
2016-12-09 16:29 aiv Status verified => closed
2016-12-09 16:40 aiv Fixed in Version => 7.1.0
2020-11-18 14:59 kgv Relationship added parent of 0031940