Hello, I am evaluating SES 4.20a. I had a similar issue some weeks ago with SES 4.18 but didn't investigate further because there was no free time then.
Trying to compile the following source code:
Display All
I get this from the compiler:
Display All
The project settings are default except for -std=c++11. When I use the default language standard (gnu98), it doesn't compile either, however, the error messages are different.
Curiously, the compiler complains about lines 11 and 12, but not 15. With SES 4.12 (which I still use as my productive tool) and all versions before, the compiler does not complain at all.
The effective definition of offsetof is apparently this one, from stddef.h, with all versions of SES.
What is wrong with using offsetof this way? What can I do to compile this? I have this phrase in lots of places in my existing code. Rewriting them all would be quite a piece of work.
Thank you for your help,
Achim
Trying to compile the following source code:
C Source Code
I get this from the compiler:
Source Code
- Building ‘Hello’ from solution ‘Hello’ in configuration ‘Debug’
- 2> Compiling ‘main.cpp’
- 2> "C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.20a/gcc/arm-none-eabi/bin/cc1plus" -fmessage-length=0 -fno-diagnostics-show-caret -fno-exceptions -fno-rtti -mcpu=cortex-m3 -mlittle-endian -mfloat-abi=soft -mthumb -mtp=soft -munaligned-access -nostdinc "-isystemC:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.20a/include" "-isystemC:/Users/achim.oetringhaus/AppData/Local/SEGGER/SEGGER Embedded Studio/v3/packages/include" -I. -D__SIZEOF_WCHAR_T=4 -D__ARM_ARCH_7M__ -D__SES_ARM -D__HEAP_SIZE__=1024 -D__SES_VERSION=42001 -D__SEGGER_LINKER -DDEBUG -MD "C:/Users/achim.oetringhaus/Documents/SEGGER Embedded Studio for ARM Projects/Hello/Output/Hello Debug/Obj/main.d" -MQ "Output/Hello Debug/Obj/main.o" -quiet -std=c++11 -g3 -gpubnames -fomit-frame-pointer -fno-dwarf2-cfi-asm -fno-builtin -ffunction-sections -fdata-sections -fshort-enums -fno-common "C:\Users\achim.oetringhaus\Documents\SEGGER Embedded Studio for ARM Projects\Hello\main.cpp" -o "C:/Users/achim.oetringhaus/Documents/SEGGER Embedded Studio for ARM Projects/Hello/Output/Hello Debug/Obj/main.asm"
- 2> In file included from C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.20a/include/cstddef:47,
- 2> from C:\Users\achim.oetringhaus\Documents\SEGGER Embedded Studio for ARM Projects\Hello\main.cpp:1:
- 2> C:\Users\achim.oetringhaus\Documents\SEGGER Embedded Studio for ARM Projects\Hello\main.cpp:11:9: error: dereferencing a null pointer in '*0'
- 2> C:\Users\achim.oetringhaus\Documents\SEGGER Embedded Studio for ARM Projects\Hello\main.cpp:11:9: error: conversion from pointer type 'int*' to arithmetic type 'size_t' {aka 'unsigned int'} in a constant expression
- 2> C:\Users\achim.oetringhaus\Documents\SEGGER Embedded Studio for ARM Projects\Hello\main.cpp:11:9: error: enumerator value for 'OfsX' is not an integer constant
- 2> C:\Users\achim.oetringhaus\Documents\SEGGER Embedded Studio for ARM Projects\Hello\main.cpp:12:11: error: dereferencing a null pointer in '*0'
- 2> C:\Users\achim.oetringhaus\Documents\SEGGER Embedded Studio for ARM Projects\Hello\main.cpp:12:11: error: conversion from pointer type 'int*' to arithmetic type 'size_t' {aka 'unsigned int'} in a constant expression
- 2> C:\Users\achim.oetringhaus\Documents\SEGGER Embedded Studio for ARM Projects\Hello\main.cpp:12:11: error: enumerator value for 'OfsY' is not an integer constant
- Build failed
The project settings are default except for -std=c++11. When I use the default language standard (gnu98), it doesn't compile either, however, the error messages are different.
Curiously, the compiler complains about lines 11 and 12, but not 15. With SES 4.12 (which I still use as my productive tool) and all versions before, the compiler does not complain at all.
The effective definition of offsetof is apparently this one, from stddef.h, with all versions of SES.
What is wrong with using offsetof this way? What can I do to compile this? I have this phrase in lots of places in my existing code. Rewriting them all would be quite a piece of work.
Thank you for your help,
Achim