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
Hello I am using this compiler with a c++ proyect and I am having compatibility problems. The problem is that the byte definition is done in std. This is the fail:
/usr/include/c++/9/cstddef:69:14: note: candidates are: ‘enum class std::byte’
69 | enum class byte : unsigned char {};
I solve it by changing the definitions of some files, I change the name of the byte definition to asn_byte. The files are:
asn1crt.h:
line 75 : uint8_t byte; line 129: byte *buf line 147: byte *buf line 181: int GetCharIndex(char ch, byte allowedCharSet[], int setLen);
Thank you for bringing this compatibility issue to our attention and for suggesting a solution. I understand your approach of changing the byte definition to asn1_byte, but implementing this change in the asn1scc could potentially break the code for other users who rely on the current definition.
As an alternative, could you try manually modifying the definition of byte in the asn1crt.h file in your project as follows?
This change uses a C++-specific approach to redefine byte as an alias for std::byte only when compiling as C++, while keeping it as uint8_t for C. This way, we can maintain compatibility with existing C code.
If this solution works for you without causing any issues, it would be great if you could make a pull request with this change. This contribution could be very valuable for other users facing similar compatibility challenges in C++ environments.
Hello I am using this compiler with a c++ proyect and I am having compatibility problems. The problem is that the byte definition is done in std. This is the fail:
/usr/include/c++/9/cstddef:69:14: note: candidates are: ‘enum class std::byte’
69 | enum class byte : unsigned char {};
I solve it by changing the definitions of some files, I change the name of the byte definition to asn_byte. The files are:
asn1crt.h:
line 75 : uint8_t byte;
line 129: byte *buf
line 147: byte *buf
line 181: int GetCharIndex(char ch, byte allowedCharSet[], int setLen);
LangGeneric_c.fs:
**line 295:**GenericLocalVariable {GenericLocalVariable.name = "arr"; varType = "byte"; arrSize = Some sReqBytesForUperEncoding; isStatic = true; initExp = None}
Header_c.stg
line 161: byte arr[];
line 184: byte arr[];
I guess this asn compiler is not intended for c++ but I hope you can make it compatible as well.
The text was updated successfully, but these errors were encountered: