Replies: 2 comments
-
I have not tried this since the dawn of flatcc because it has not been necessary until now, but you can replace alignas with pragma pack(1) which also inserts explicit zero padding fields in structs. I'm not sure if flatcc still compiles with it, and if it does, I'm not sure the output is correct, but you could try to use it while editing and then generate the final output as usual. Unfortunately this particular setting is not guarded by #ifndef, so you have to edit the config file: Line 390 in a889e48 |
Beta Was this translation helpful? Give feedback.
-
Another option might be to edit the portable file the provides the alignas feature portably, and if eclipse is defined somehow, define alignas as the empty macro. Depending on how the syntax checker works, this might resolve the issue. |
Beta Was this translation helpful? Give feedback.
-
I am using Flatbuffers in an Eclipse based embedded application and functionally it works perfectly.
One hiccup though I have come across is that Eclipse does not seem to like the "alignas(X)" key words in front of the struct field entries.
As an example, take the following struct which is lifted from the specialized reader file generated by the flatCC compiler.
Each line is declared a "Syntax Error" by Eclipse. Then, future references to the entries result in a "Field could not be resolved" error. However, as mentioned, it still builds/compiles just fine. (If I remove the alignas(X) the syntax error goes away.)
Is there any way to eliminate these error messages from showing up?
Note: I have PORTABLE_C11_ALIGNED_ALLOC defined to zero in my symbol table.
Beta Was this translation helpful? Give feedback.
All reactions