foo.cc: In static member function 'static void Complex::Sort(std::vector<Complex>*)':
foo.cc:99:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
99 | for (i = 0; i<ptr_vtInstance->size(); i++)
| ~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc:106:47: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
106 | for (j = 0; j < ptr_vtComplex->size(); j++)
| ~~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc:115:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
115 | if (j == ptr_vtComplex->size())
| ~~^~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:120:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
120 | for (i = 0; i<ptr_vtComplex->size(); i++)
| ~^~~~~~~~~~~~~~~~~~~~~~
foo.cc: In static member function 'static void Complex::VectorDisplay(std::vector<Complex>*)':
foo.cc:156:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Complex>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
156 | for (i = 0; i < ptr_vtInstance->size(); i++)
| ~~^~~~~~~~~~~~~~~~~~~~~~~~
In static member function 'static void Complex::Bubble(Complex*, int)',
inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:132:54: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
132 | if (ary_objComplex[j]>ary_objComplex[j + 1])
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
208 | ary_objComplex = new Complex[nSize];
| ^
In member function 'bool Complex::operator>(Complex)',
inlined from 'static void Complex::Bubble(Complex*, int)' at foo.cc:132:26,
inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:68:29: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
68 | if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) > sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
| ~~~^~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
208 | ary_objComplex = new Complex[nSize];
| ^
In member function 'bool Complex::operator>(Complex)',
inlined from 'static void Complex::Bubble(Complex*, int)' at foo.cc:132:26,
inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:68:50: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
68 | if (sqrt(pow(this->real, 2) + pow(this->imaginary, 2)) > sqrt(pow(objRight.real, 2) + pow(objRight.imaginary, 2)))
| ~~~^~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
208 | ary_objComplex = new Complex[nSize];
| ^
In static member function 'static void Complex::Bubble(Complex*, int)',
inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:135:59: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
135 | ary_objComplex[j] = ary_objComplex[j + 1];
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
208 | ary_objComplex = new Complex[nSize];
| ^
In static member function 'static void Complex::Bubble(Complex*, int)',
inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:135:59: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
135 | ary_objComplex[j] = ary_objComplex[j + 1];
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
208 | ary_objComplex = new Complex[nSize];
| ^
In static member function 'static void Complex::Bubble(Complex*, int)',
inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:136:63: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
136 | ary_objComplex[j + 1] = objTemp;
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
208 | ary_objComplex = new Complex[nSize];
| ^
In static member function 'static void Complex::Bubble(Complex*, int)',
inlined from 'int main(int, char**)' at foo.cc:217:17:
foo.cc:136:63: warning: array subscript [2, 5] is outside array bounds of 'void [8]' [-Warray-bounds]
136 | ary_objComplex[j + 1] = objTemp;
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset [16, 40] into object of size 8 allocated by 'operator new []'
208 | ary_objComplex = new Complex[nSize];
| ^
In member function 'void Complex::setReal(int)',
inlined from 'int main(int, char**)' at foo.cc:214:28:
foo.cc:33:28: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
33 | this->real = real;
| ~~~~~~~~~~~^~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
208 | ary_objComplex = new Complex[nSize];
| ^
In member function 'void Complex::setImaginary(int)',
inlined from 'int main(int, char**)' at foo.cc:215:33:
foo.cc:42:33: warning: array subscript 1 is outside array bounds of 'void [8]' [-Warray-bounds]
42 | this->imaginary = imaginary;
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~
foo.cc: In function 'int main(int, char**)':
foo.cc:208:43: note: at offset 8 into object of size 8 allocated by 'operator new []'
208 | ary_objComplex = new Complex[nSize];
| ^
[Hydro](https://hydro.ac)提供评测服务