You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C99 support is quite widespread (source) and even if declared "partial", designated initializers should be available on any major, modern compiler (however, this cross-compiler support doesn't matter, since the code relies on an ancient GCC extension anyway). And to ensure that on GCC it still works as before, a simple preprocessor macro might be prepared to choose between two syntaxes.
There are also other standard options of struct initialization, like using a factory function or setting fields manually. I believe that this would not introduce any performance hit (if that worried you), since there are very few places that use that syntax and in most of them we return the initialized struct immediately.
I might prepare a pull request for that change.
The text was updated successfully, but these errors were encountered:
get_nibble 、set_nibble 、get_byte where they defined?
2.what is bitfield.h and bitfield.c ? where they defined?
thanks!!
Error: L6218E: Undefined symbol get_byte (referred from receive.o).
Error: L6218E: Undefined symbol get_nibble (referred from receive.o).
Error: L6218E: Undefined symbol set_nibble (referred from receive.o).
get_nibble 、set_nibble 、get_byte where they defined?
2.what is bitfield.h and bitfield.c ? where they defined?
thanks!!
Error: L6218E: Undefined symbol get_byte (referred from receive.o).
Error: L6218E: Undefined symbol get_nibble (referred from receive.o).
Error: L6218E: Undefined symbol set_nibble (referred from receive.o).
These are all defined in bitfield-c: https://github.com/openxc/bitfield-c. This is a dependency in the deps/ folder for isotp-c. Try a git submodule update --init
The code uses an obsolete GCC extension syntax for struct initialization.
Example:
This syntax is obsolete since GCC 2.5 (released in 1993!) (source: Designated Inits, source: GCC releases)
There are a few alternatives to this. One of which is a standarized version of field initialization introduced in C99:
C99 support is quite widespread (source) and even if declared "partial", designated initializers should be available on any major, modern compiler (however, this cross-compiler support doesn't matter, since the code relies on an ancient GCC extension anyway). And to ensure that on GCC it still works as before, a simple preprocessor macro might be prepared to choose between two syntaxes.
There are also other standard options of struct initialization, like using a factory function or setting fields manually. I believe that this would not introduce any performance hit (if that worried you), since there are very few places that use that syntax and in most of them we return the initialized struct immediately.
I might prepare a pull request for that change.
The text was updated successfully, but these errors were encountered: