n4ogw / so2sdr

Ham radio contest logging program
http://n4ogw.github.io/so2sdr/
GNU General Public License v3.0
19 stars 3 forks source link

Does not build with GCC 6.1.1 #4

Closed markusgrosser closed 7 years ago

markusgrosser commented 8 years ago

I think I'll just dump the error here, since that should contain all the necessary information.

Putting (char) around the ill-typed constants in the array definition fixes the issue, but I'm sure a more idiomatic fix for this is possible. After fixing, the program seems to be running without problems (though I haven't dug around too much yet since I don't have access to a radio at the moment).

g++ -c -pipe -O2 -DINSTALL_DIR=\"/usr/local\" -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -pthread -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -I. -I../qttelnet/src -isystem /usr/include/libusb-1.0 -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtSql -isystem /usr/include/qt/QtSerialPort -isystem /usr/include/qt/QtCore -I. -I. -I/usr/lib/qt/mkspecs/linux-g++ -o qttelnet.o ../qttelnet/src/qttelnet.cpp
../qttelnet/src/qttelnet.cpp: In member function 'virtual QByteArray QtTelnetAuthNull::authStep(const QByteArray&)':
../qttelnet/src/qttelnet.cpp:489:43: error: narrowing conversion of '255u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
                    Common::IAC, Common::SE};
                                           ^
../qttelnet/src/qttelnet.cpp:489:43: error: narrowing conversion of '250u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
../qttelnet/src/qttelnet.cpp:489:43: error: narrowing conversion of '255u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
../qttelnet/src/qttelnet.cpp:489:43: error: narrowing conversion of '240u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
../qttelnet/src/qttelnet.cpp: In member function 'void QtTelnetPrivate::parseSubTT(const QByteArray&)':
../qttelnet/src/qttelnet.cpp:665:58: error: narrowing conversion of '255u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
                          Common::TerminalType, Common::IS};
                                                          ^
../qttelnet/src/qttelnet.cpp:665:58: error: narrowing conversion of '250u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
../qttelnet/src/qttelnet.cpp:668:50: error: narrowing conversion of '255u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
     const char c2[2] = { Common::IAC, Common::SE };
                                                  ^
../qttelnet/src/qttelnet.cpp:668:50: error: narrowing conversion of '240u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
../qttelnet/src/qttelnet.cpp: In member function 'void QtTelnetPrivate::sendWindowSize()':
../qttelnet/src/qttelnet.cpp:856:49: error: narrowing conversion of '255u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
                         Common::IAC, Common::SE };
                                                 ^
../qttelnet/src/qttelnet.cpp:856:49: error: narrowing conversion of '250u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
../qttelnet/src/qttelnet.cpp:855:28: warning: narrowing conversion of '(int)(((short int)((int)w)) & 255)' from 'int' to 'char' inside { } [-Wnarrowing]
                         (w & 0x00ff), (w >> 8), (h & 0x00ff), (h >> 8),
                         ~~~^~~~~~~~~
../qttelnet/src/qttelnet.cpp:855:42: warning: narrowing conversion of '(((int)w) >> 8)' from 'int' to 'char' inside { } [-Wnarrowing]
                         (w & 0x00ff), (w >> 8), (h & 0x00ff), (h >> 8),
                                       ~~~^~~~~
../qttelnet/src/qttelnet.cpp:855:52: warning: narrowing conversion of '(int)(((short int)((int)h)) & 255)' from 'int' to 'char' inside { } [-Wnarrowing]
                         (w & 0x00ff), (w >> 8), (h & 0x00ff), (h >> 8),
                                                 ~~~^~~~~~~~~
../qttelnet/src/qttelnet.cpp:855:66: warning: narrowing conversion of '(((int)h) >> 8)' from 'int' to 'char' inside { } [-Wnarrowing]
                         (w & 0x00ff), (w >> 8), (h & 0x00ff), (h >> 8),
                                                               ~~~^~~~~
../qttelnet/src/qttelnet.cpp:856:49: error: narrowing conversion of '255u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
                         Common::IAC, Common::SE };
                                                 ^
../qttelnet/src/qttelnet.cpp:856:49: error: narrowing conversion of '240u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
../qttelnet/src/qttelnet.cpp: In member function 'void QtTelnetPrivate::sendCommand(char, char)':
../qttelnet/src/qttelnet.cpp:900:56: error: narrowing conversion of '255u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
     const char c[3] = { Common::IAC, operation, option };
                                                        ^
../qttelnet/src/qttelnet.cpp: In member function 'void QtTelnet::sendControl(QtTelnet::Control)':
../qttelnet/src/qttelnet.cpp:1112:44: error: narrowing conversion of '255u' from 'uchar {aka unsigned char}' to 'char' inside { } [-Wnarrowing]
     const char command[2] = {Common::IAC, c};
                                            ^
n4ogw commented 7 years ago

This should be fixed now