Hi.
I have a project I've been developing in SES that uses protocol buffers generated using nanopb. What I've found is that, when I add the generated files to my project, it has several assertions that produce errors and warnings. As an example, one of the failing assertions is below. Building this code emits the error
This assertion was created using the offsetof() macro. SetVolume is simply defined as
I've been working with nanopb's maintainer to troubleshoot this issue. Essentially, what it seems to boil down to is a problem in Segger's definition of offsetof(). I'm using SES 6.20a, and offsetof() is defined in stddef.h as below:
I also have version 5.70a installed, so I checked what stddef.h looks like in this version.
When using this definition, my project builds correctly. It looks like someone else has brought this issue up in the past, as per forum.segger.com/index.php/Thr…iler-error-from-offsetof/ . This thread is "solved", implying that the definition was updated at that time to use the __builtin_offsetof extension. So, the 6.20a removal of this definition appears to be a regression that breaks my code. Is there any reason Segger has removed support for gcc and clang's __builtin_offsetof extension?
I have a project I've been developing in SES that uses protocol buffers generated using nanopb. What I've found is that, when I add the generated files to my project, it has several assertions that produce errors and warnings. As an example, one of the failing assertions is below. Building this code emits the error
static_assert expression is not an integral constant expression
and the warning cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression
. Note that the assertion is not evaluating to false. Rather, the code inside is generating a compile-time error.This assertion was created using the offsetof() macro. SetVolume is simply defined as
I've been working with nanopb's maintainer to troubleshoot this issue. Essentially, what it seems to boil down to is a problem in Segger's definition of offsetof(). I'm using SES 6.20a, and offsetof() is defined in stddef.h as below:
I also have version 5.70a installed, so I checked what stddef.h looks like in this version.