headers: Add macro to print error code as string - #366
Conversation
* Adds a PRINT_SGX_STATUS macro to sgx_error.h which prints the sgx_status_t as a string.
|
Generated with: (
echo -e '#define PRINT_SGX_STATUS(FILE_STRUCT, STATUS_T) \\\n switch (STATUS_T) {\\';
for error in $(grep -E '=.*SGX_MK_ERROR' /opt/intel/sgxsdk/include/sgx_error.h | awk '{print $1}' | sed 's/=//g'); do
printf ' case %s:\\\n fprintf(FILE_STRUCT, "Error: %s\\n");\\\n break;\\\n' $error $error;
done;
echo -e ' }'
) |
|
maybe this would be better as something similar to |
|
Might be even better to make it similar to |
|
Ya that is probably a better option, I think that's what was started in #346 perhaps that PR should be one PR introducing the |
|
Something similar is going on in the examples |
|
Hello, I was disinclined to continue working on my pull request after the comment from the Intel member himself saying that maybe it did not help much. And I still maintain my position, I think it is very important and avoids many lines of unnecessary codes that will be inserted in each enclave. |
|
I agree. As I posted above something similar was done in the sample enclave code. If its useful there then it is of course useful and instead of duplicating that functionality it should be a part of the SDK. |
|
I believe that it's a really useful patch. |
|
Important 🔀 The Intel® SGX SDK codebase has movedThank you for your contribution! If you have any questions or need assistance migrating, please ask here. As we complete the migration, older pull requests may eventually be closed. No work is lost, though, and you are welcome to re-open your change in the new repository at any time. Footnotes
|
PRINT_SGX_STATUSmacro to sgx_error.h which printsthe
sgx_status_tas a string.