-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename dlt_common.c into dlt_common.cpp. #506
Conversation
I believe the issue is not in the fact that this file is compiled by C-compiler (at the end it contains C-code and not C++), the problem is that |
@vifactor looks like the macOS and windows builds are now failing... |
@LocutusOfBorg yeah, I see... Making it a clean way does not seem easy. Maybe maintainers will accept your initial change: simple renaming. Out of curiosity: what combination of OS, compiler and build system produces that error for you? |
pushed again! |
@vifactor it's an up-to-date debian sid |
@LocutusOfBorg Please add a signed off statement to your commit message, then i will merge. |
This makes sure c++ compiler is used and not plain c, failing with some error like [ 10%] Building C object qdlt/CMakeFiles/qdlt.dir/dlt_common.c.o cd /dlt-viewer/obj-x86_64-linux-gnu/qdlt && /usr/bin/cc -DBYTE_ORDER=LITTLE_ENDIAN -DPLUGIN_INSTALLATION_PATH=\"/usr/lib/x86_64-linux-gnu/dlt-viewer/plugins\" -DQT5 -DQT5_QT6_COMPAT -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_SERIALPORT_LIB -DQT_VIEWER -D_TTY_POSIX_ -Dqdlt_EXPORTS -I/dlt-viewer/obj-x86_64-linux-gnu/qdlt -I/dlt-viewer/qdlt -I/dlt-viewer/obj-x86_64-linux-gnu/qdlt/qdlt_autogen/include -I/dlt-viewer/qdlt/../src -isystem /usr/include/x86_64-linux-gnu/qt6/QtCore -isystem /usr/include/x86_64-linux-gnu/qt6 -isystem /usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -isystem /usr/include/x86_64-linux-gnu/qt6/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt6/QtSerialPort -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/dlt-viewer=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -fPIC -Wall -Wextra -pedantic -Wno-variadic-macros -Wno-strict-aliasing -fPIC -MD -MT qdlt/CMakeFiles/qdlt.dir/dlt_common.c.o -MF CMakeFiles/qdlt.dir/dlt_common.c.o.d -o CMakeFiles/qdlt.dir/dlt_common.c.o -c /dlt-viewer/qdlt/dlt_common.c In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:37, from /usr/include/x86_64-linux-gnu/qt6/QtCore/QtGlobal:1, from /dlt-viewer/qdlt/export_rules.h:1, from /dlt-viewer/qdlt/dlt_common.h:67, from /dlt-viewer/qdlt/dlt_common.c:70: /usr/include/x86_64-linux-gnu/qt6/QtCore/qtypes.h:163:15: error: expected declaration specifiers or '...' before 'sizeof' 163 | static_assert(sizeof(ptrdiff_t) == sizeof(size_t), "Weird ptrdiff_t and size_t definitions"); | ^~~~~~ /usr/include/x86_64-linux-gnu/qt6/QtCore/qtypes.h:163:52: error: expected declaration specifiers or '...' before string constant 163 | static_assert(sizeof(ptrdiff_t) == sizeof(size_t), "Weird ptrdiff_t and size_t definitions"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /dlt-viewer/qdlt/dlt_common.c: In function 'dlt_message_header_flags': /dlt-viewer/qdlt/dlt_common.c:753:47: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member] 753 | timeinfo = localtime ((const time_t*)(&(msg->storageheader->seconds))); Signed-off-by: Gianfranco Costamagna <[email protected]> Signed-off-by: Gianfranco Costamagna <[email protected]>
done! |
@LocutusOfBorg Sorry i had to revert the changes. They are not working in Windows with qmake and VisualC++ compiler. Some further changes possibly needed. |
This makes sure c++ compiler is used and not plain c, failing with some error. Signed-off-by: Gianfranco Costamagna <[email protected]> Signed-off-by: Gianfranco Costamagna <[email protected]>
This makes sure c++ compiler is used and not plain c, failing with some error like
[ 10%] Building C object qdlt/CMakeFiles/qdlt.dir/dlt_common.c.o
cd /dlt-viewer/obj-x86_64-linux-gnu/qdlt && /usr/bin/cc -DBYTE_ORDER=LITTLE_ENDIAN -DPLUGIN_INSTALLATION_PATH="/usr/lib/x86_64-linux-gnu/dlt-viewer/plugins" -DQT5 -DQT5_QT6_COMPAT -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_SERIALPORT_LIB -DQT_VIEWER -D_TTY_POSIX_ -Dqdlt_EXPORTS -I/dlt-viewer/obj-x86_64-linux-gnu/qdlt -I/dlt-viewer/qdlt -I/dlt-viewer/obj-x86_64-linux-gnu/qdlt/qdlt_autogen/include -I/dlt-viewer/qdlt/../src -isystem /usr/include/x86_64-linux-gnu/qt6/QtCore -isystem /usr/include/x86_64-linux-gnu/qt6 -isystem /usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -isystem /usr/include/x86_64-linux-gnu/qt6/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt6/QtSerialPort -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/dlt-viewer=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu99 -fPIC -Wall -Wextra -pedantic -Wno-variadic-macros -Wno-strict-aliasing -fPIC -MD -MT qdlt/CMakeFiles/qdlt.dir/dlt_common.c.o -MF CMakeFiles/qdlt.dir/dlt_common.c.o.d -o CMakeFiles/qdlt.dir/dlt_common.c.o -c /dlt-viewer/qdlt/dlt_common.c
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:37,
from /usr/include/x86_64-linux-gnu/qt6/QtCore/QtGlobal:1,
from /dlt-viewer/qdlt/export_rules.h:1,
from /dlt-viewer/qdlt/dlt_common.h:67,
from /dlt-viewer/qdlt/dlt_common.c:70:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qtypes.h:163:15: error: expected declaration specifiers or '...' before 'sizeof'
163 | static_assert(sizeof(ptrdiff_t) == sizeof(size_t), "Weird ptrdiff_t and size_t definitions");
| ^~~~~~
/usr/include/x86_64-linux-gnu/qt6/QtCore/qtypes.h:163:52: error: expected declaration specifiers or '...' before string constant
163 | static_assert(sizeof(ptrdiff_t) == sizeof(size_t), "Weird ptrdiff_t and size_t definitions");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/dlt-viewer/qdlt/dlt_common.c: In function 'dlt_message_header_flags':
/dlt-viewer/qdlt/dlt_common.c:753:47: warning: taking address of packed member of 'struct ' may result in an unaligned pointer value [-Waddress-of-packed-member]
753 | timeinfo = localtime ((const time_t*)(&(msg->storageheader->seconds)));