MantisBT - Open CASCADE
View Issue Details
0029152Open CASCADE[OCCT] OCCT:Codingpublic2017-09-28 13:042018-06-29 21:19
kgv 
bugmaster 
normalminor 
closedfixed 
[OCCT] 7.2.0 
[OCCT] 7.3.0[OCCT] 7.3.0 
Not required
0029152: Coding Rules - eliminate GCC compiler warnings -Wmisleading-indentation when using MinGW
There is a set of compiler warnings which is generated by GCC7.1 coming with MinGW-w64:
C:\occt_mingw64\src\OSD\OSD_Directory.cxx: In member function 'void OSD_Directory::Build(const OSD_Protection&)':

C:\occt_mingw64\src\OSD\OSD_Directory.cxx:128:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  
if (  dirName.IsEmpty ()  )
  ^~
C:\occt_mingw64\src\OSD\OSD_Directory.cxx:132:3: note: ...this statement, but the latter is misleadingly 
indented as if it were guarded by the 'if'
   Standard_Boolean isOK = Exists();
   ^~~~~~~~~~~~~~~~
C:\occt_mingw64\src\OSD\OSD_Disk.cxx: In function 'void _osd_wnt_set_disk_name(TCollection_AsciiString&, 
const OSD_Path&)':
C:\occt_mingw64\src\OSD\OSD_Disk.cxx:365:4: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    
for ( i = 3, k = 0; i <= j; ++i )
    ^~~
C:\occt_mingw64\src\OSD\OSD_Disk.cxx:382:5: note: ...this statement, but the latter is misleadingly indented 
as if it were guarded by the 'for'
     if ( k == 0 )
     ^~
C:\occt_mingw64\src\OSD\OSD_File.cxx: In member function 'void OSD_File::BuildTemporary()':
C:\occt_mingw64\src\OSD\OSD_File.cxx:1457:17: warning: ISO C++ forbids converting a string constant to 
'wchar_t*' [-Wwrite-strings]
                 };
                 ^
No tags attached.
related to 0029151closed abv Coding Rules - eliminate GCC compiler warnings -Wimplicit-fallthrough 
Issue History
2017-09-28 13:04kgvNew Issue
2017-09-28 13:04kgvAssigned To => kgv
2017-09-28 13:04kgvRelationship addedrelated to 0029151
2017-09-28 21:30gitNote Added: 0070947
2017-09-28 21:48gitNote Added: 0070948
2017-09-29 01:20kgvNote Added: 0070951
2017-09-29 01:20kgvAssigned Tokgv => abv
2017-09-29 01:20kgvStatusnew => resolved
2017-09-29 10:11kgvDescription Updatedbug_revision_view_page.php?rev_id=17765#r17765
2017-09-29 11:51abvNote Added: 0070966
2017-09-29 11:51abvAssigned Toabv => kgv
2017-09-29 11:51abvStatusresolved => feedback
2017-09-29 11:53kgvNote Added: 0070967
2017-09-29 12:07gitNote Added: 0070968
2017-09-29 12:08kgvNote Added: 0070969
2017-09-29 12:08kgvAssigned Tokgv => abv
2017-09-29 12:08kgvStatusfeedback => resolved
2017-09-29 20:19gitNote Added: 0071081
2017-10-01 21:08gitNote Added: 0071097
2017-10-01 21:10gitNote Added: 0071098
2017-10-01 21:11abvNote Added: 0071099
2017-10-01 21:11abvAssigned Toabv => bugmaster
2017-10-01 21:11abvStatusresolved => reviewed
2017-10-01 22:06gitNote Added: 0071102
2017-10-03 09:41bugmasterNote Added: 0071136
2017-10-03 09:41bugmasterStatusreviewed => tested
2017-10-03 09:52bugmasterTest case number => Not required
2017-10-06 14:55bugmasterChangeset attached => occt master cda06ac0
2017-10-06 14:55bugmasterStatustested => verified
2017-10-06 14:55bugmasterResolutionopen => fixed
2017-10-14 12:20gitNote Added: 0071467
2017-10-14 12:20gitNote Added: 0071468
2018-02-20 12:59aivTarget Version7.4.0* => 7.3.0
2018-06-29 21:15aivFixed in Version => 7.3.0
2018-06-29 21:19aivStatusverified => closed

Notes
(0070947)
git   
2017-09-28 21:30   
Branch CR29152 has been created by kgv.

SHA-1: f96dad9b47183dd0581cfdbdcdf5edf2ad54a5b0


Detailed log of new commits:

Author: kgv
Date: Thu Sep 28 21:29:22 2017 +0300

    0029152: Coding Rules - eliminate GCC compiler warnings -Wmisleading-indentation when using MinGW
(0070948)
git   
2017-09-28 21:48   
Branch CR29152 has been updated forcibly by kgv.

SHA-1: 6e31163292ec6b5d5e475d6cb21f175b00ccfd3c
(0070951)
kgv   
2017-09-29 01:20   
Patch is ready for review.
http://jenkins-test-10.nnov.opencascade.com/view/CR29152-master-KGV/ [^]
(0070966)
abv   
2017-09-29 11:51   
How can I review it? These files are completely rewritten, and there is no description of the actual changes made!
(0070967)
kgv   
2017-09-29 11:53   
The warning is generated for badly formatted code, hence patch applies reformatting.
(0070968)
git   
2017-09-29 12:07   
Branch CR29152 has been updated forcibly by kgv.

SHA-1: e43f2ed0959d1e7002c02ef0f7e693b5eda9eed5
(0070969)
kgv   
2017-09-29 12:08   
0029152: Coding Rules - eliminate GCC compiler warnings -Wmisleading-indentation when using MinGW

OSD_File::myFileHandle/myIO pair is now switched within class definition
instead of myFileHandle_is_only_for_Windows/myFileChannel_is_only_for_Linux macros.

Unused field OSD_Disk::myQuotaSize has been removed.

OSD_Directory/OSD_Disk/OSD_File methods implementation of WinAPI/non-WinAPI
has been merged within .cxx file and reformatted.
Resolved several inconsistences on handling invalid input
between WinAPI/non-WinAPI implementations.
NCollection_Array1 is now used in several places instead of
raw memory allocation (HeapAlloc()/HeapFree()/new/delete).
TCollection_ExtendedString is used instead of StringCchCopyW.
(0071081)
git   
2017-09-29 20:19   
Branch CR29152_1 has been created by abv.

SHA-1: eacfa8cae64b3e0721d234fd2e55a5b16f6a5400


Detailed log of new commits:

Author: kgv
Date: Thu Sep 28 21:29:22 2017 +0300

    0029152: Coding Rules - eliminate GCC compiler warnings -Wmisleading-indentation when using MinGW
    
    OSD_File::myFileHandle/myIO pair is now switched within class definition
    instead of myFileHandle_is_only_for_Windows/myFileChannel_is_only_for_Linux macros.
    
    Unused field OSD_Disk::myQuotaSize has been removed.
    
    OSD_Directory/OSD_Disk/OSD_File methods implementation of WinAPI/non-WinAPI
    has been merged within .cxx file and reformatted.
    Resolved several inconsistences on handling invalid input
    between WinAPI/non-WinAPI implementations.
    NCollection_Array1 is now used in several places instead of
    raw memory allocation (HeapAlloc()/HeapFree()/new/delete).
    TCollection_ExtendedString is used instead of StringCchCopyW.
    
    Obsolete code fragment "for Visual Age compiler" is removed.
    Macro __try is undefined before redefinition on MinGW to avoid warning.
(0071097)
git   
2017-10-01 21:08   
Branch CR29152_1 has been updated forcibly by abv.

SHA-1: 18002ba46b1f521758fc8d97984996b96eed7073
(0071098)
git   
2017-10-01 21:10   
Branch CR29152_1 has been updated forcibly by abv.

SHA-1: fcaee9b15b80be3e1ce456bc5f145734068723ce
(0071099)
abv   
2017-10-01 21:11   
Reviewed with some additional corrections, see branch CR29152_1
(0071102)
git   
2017-10-01 22:06   
Branch CR29152_1 has been updated forcibly by abv.

SHA-1: 0e7bc01a3198b0db56f1ca34d27200ecef234ca2
(0071136)
bugmaster   
2017-10-03 09:41   
Tested in framework of testing issue 29170
(0071467)
git   
2017-10-14 12:20   
Branch CR29152 has been deleted by kgv.

SHA-1: e43f2ed0959d1e7002c02ef0f7e693b5eda9eed5
(0071468)
git   
2017-10-14 12:20   
Branch CR29152_1 has been deleted by kgv.

SHA-1: 0e7bc01a3198b0db56f1ca34d27200ecef234ca2