MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #28978 All Revisions ] Back to Issue ]
Summary 0028978: Coding rules - suppress GCC compiler warnings -Warray-bounds within NCollection_Array1
Revision 2017-08-07 18:04 by kgv
Description The GCC 6.3.0 -Warray-bounds warnings for NCollection_Array1 constructor are misleading and should be suppressed.
/occt.git/inc/../src/NCollection/NCollection_Array1.hxx|215|warning: array subscript is below array bounds 
[-Warray-bounds]|


The warnings are emitted for a code initializing NCollection_Array1 from a local array with an lower index 1+, so that (Start-1) points out of local array range - but it is expected, since NCollection_Array1 stores pointer with this shift intentionally (to avoid shift within method accessing each element).

  Standard_Real knot_array[2] ;
  TColStd_Array1OfReal  the_knots(knot_array[0],1,2),
Revision 2017-08-07 17:47 by kgv
Description The GCC -Warray-bounds warnings for NCollection_Array1 constructor are misleading and should be suppressed.
/occt.git/inc/../src/NCollection/NCollection_Array1.hxx|215|warning: array subscript is below array bounds 
[-Warray-bounds]|


The warnings are emitted for a code initializing NCollection_Array1 from a local array with an lower index 1+, so that (Start-1) points out of local array range - but it is expected, since NCollection_Array1 stores pointer with this shift intentionally (to avoid shift within method accessing each element).

  Standard_Real knot_array[2] ;
  TColStd_Array1OfReal  the_knots(knot_array[0],1,2),
Revision 2017-08-07 17:45 by kgv
Description The GCC -Warray-bounds warnings for NCollection_Array1 constructor are misleading and should be suppressed.
/occt.git/inc/../src/NCollection/NCollection_Array1.hxx|215|warning: array subscript is below array bounds 
[-Warray-bounds]|


The warnings are emitted for a code initializing NCollection_Array1 from a local array with an lower index 1+, so that (Start-1) points out of local array range - but it is expected, since NCollection_Array1 stores pointer with this shift intentionally (to avoid shift within method accessing each element).


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker