Opened 3 years ago

Closed 3 years ago

#544 closed ожидается проверка (задача сдана)

lab_08 = shared_ptr

Reported by: petrov.vladimir Owned by: Святослав Власов
Component: WW shared_ptr Version: 2.0
Keywords: Cc:

Description


Change History (3)

comment:1 Changed 3 years ago by Святослав Власов

Type: ожидается проверкаожидаются исправления

Не скомпилировалось

[501][svloyso:lab_08]$ make
mkdir -p bin
g++ -O2 -Wall -Werror -std=c++11 -Iinclude -c -MMD -o bin/main.o src/main.cpp
g++ -O2 -Wall -Werror -std=c++11 -Iinclude -c -MMD -o bin/matrix.o src/matrix.cpp
src/matrix.cpp: In constructor ‘Matrix::Matrix(std::size_t, std::size_t)’:
src/matrix.cpp:18:26: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   18 |         for(int i = 1; i < _rows; i ++) {
      |                        ~~^~~~~~~
src/matrix.cpp: In copy constructor ‘Matrix::Matrix(const Matrix&)’:
src/matrix.cpp:38:26: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   38 |         for(int i = 1; i < _rows; i ++) {
      |                        ~~^~~~~~~
src/matrix.cpp: In member function ‘void Matrix::print(FILE*)’:
src/matrix.cpp:63:22: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   63 |     for(int i = 0; i < _rows; i++) {
      |                    ~~^~~~~~~
src/matrix.cpp:64:26: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   64 |         for(int j = 0; j < _cols; j++) {
      |                        ~~^~~~~~~
src/matrix.cpp: In member function ‘bool Matrix::operator==(const Matrix&)’:
src/matrix.cpp:74:22: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   74 |     for(int i = 0; i < _rows; i++) {
      |                    ~~^~~~~~~
src/matrix.cpp:75:26: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   75 |         for(int j = 0; j < _cols; j++) {
      |                        ~~^~~~~~~
src/matrix.cpp: In member function ‘Matrix& Matrix::operator+=(const Matrix&)’:
src/matrix.cpp:97:22: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   97 |     for(int i = 0; i < _rows; i ++) {
      |                    ~~^~~~~~~
src/matrix.cpp:98:26: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   98 |         for(int j = 0; j < _cols; j++) {
      |                        ~~^~~~~~~
src/matrix.cpp: In member function ‘Matrix& Matrix::operator-=(const Matrix&)’:
src/matrix.cpp:106:22: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  106 |     for(int i = 0; i < _rows; i ++) {
      |                    ~~^~~~~~~
src/matrix.cpp:107:26: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  107 |         for(int j = 0; j < _cols; j++) {
      |                        ~~^~~~~~~
src/matrix.cpp: In member function ‘int** Matrix::multiply_array(const Matrix&, const Matrix&)’:
src/matrix.cpp:125:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘const size_t’ {aka ‘const long unsigned int’} [-Werror=sign-compare]
  125 |         for (int i = 0; i < m1._rows; i++) {
      |                         ~~^~~~~~~~~~
src/matrix.cpp:129:31: error: comparison of integer expressions of different signedness: ‘int’ and ‘const size_t’ {aka ‘const long unsigned int’} [-Werror=sign-compare]
  129 |             for (int j = 0; j < m2._cols; j++) {
      |                             ~~^~~~~~~~~~
src/matrix.cpp:131:38: error: comparison of integer expressions of different signedness: ‘int’ and ‘const size_t’ {aka ‘const long unsigned int’} [-Werror=sign-compare]
  131 |                 for(int pos = 0; pos < m1._cols; pos++) {
      |                                  ~~~~^~~~~~~~~~
cc1plus: all warnings being treated as errors

comment:2 Changed 3 years ago by petrov.vladimir

Type: ожидаются исправленияожидается проверка
Version: 1.02.0

заменил все int на std::size_t где нужно
запустил на линуксе, скомпилировалось
надеюсь, теперь будет ок!)

comment:3 Changed 3 years ago by Святослав Власов

Resolution: задача сдана
Status: assignedclosed

8/10

Note: See TracTickets for help on using tickets.