kaoh / globalplatform

C library + command-line for Open- / GlobalPlatform smart cards
https://kaoh.github.io/globalplatform/
Other
72 stars 30 forks source link

Use defined constant for receive APDU length #47

Closed spaikmos closed 3 years ago

spaikmos commented 3 years ago

Visual Studio generates an error when using a variable to set the length of an array. GCC allows this, but it is not part of the C standard. Hence, use a constant expression to set both the initial recveAPDULen and recvAPDU array length.

kaoh commented 3 years ago

Thanks a lot. Strange that this has not yet become an issue, although I have been using VS also for the Windows builds.

spaikmos commented 3 years ago

Weird... I'm using VS2019, dunno if there's an option or flag that needs to be set to enable this construct in C.

This answer in stack overflow explains the issue in more detail.

kaoh commented 3 years ago

Maybe there was a change between VS 2017 and VS 2019. Maybe this was also introduced by some patches after version 2.0.0 was released.