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
Currently when an error occures e. g. during kernel compilation, there are some error mesages printed to stdout. In our project, we have our own error handling and we do not want anything printed to stdout.
I would like to propose a native way to disable this behaviour e. g. by defining VKFFT_DISABLE_DEBUG_PRINTF macro or something similar before including the vkFFT.h header. It would be possible to implement it like:
I will add this change, thank you. This also made me think that I can replace all sprintf calls with a macro that selects sprintf/snprintf based on user choice.
why do you consider still using sprintf? Is there any advantage over using snprintf? snprintf prevents the buffer overflow plus you can check if all of the characters were written to the string as "the number of characters that would be written to the string if it was long enough" is returned.
However, in each case I would suggest checking the return sprintf or snprintf - if negative, an error during formatting occured.
snprintf is not part of C89 and some older versions of MSVC do not support it. However, making printing as a macro solves both issues, so it is a good solution.
Currently when an error occures e. g. during kernel compilation, there are some error mesages printed to
stdout
. In our project, we have our own error handling and we do not want anything printed tostdout
.I would like to propose a native way to disable this behaviour e. g. by defining
VKFFT_DISABLE_DEBUG_PRINTF
macro or something similar before including thevkFFT.h
header. It would be possible to implement it like:and replace every
printf(...)
call withVKFFT_PRINTF(...)
. Also it might be a better idea to output the error messages tostderr
insted ofstdout
.How do you feel about this change?
Thank you very much.
Best regards
David
The text was updated successfully, but these errors were encountered: