replace snprintf with a C++98 equivalent#3361
replace snprintf with a C++98 equivalent#3361ronghanghu merged 1 commit intoBVLC:masterfrom BonsaiAI:avoid-snprintf
Conversation
|
IMHO Note: Microsoft has finally implemented |
|
@ronghanghu specifically, |
|
Opinions on this PR? |
|
This all looks good to me. I'll try to review during the Thanksgiving (got a bit overwhelmed myself these days since it is near the end of the semester). |
|
@ronghanghu thanks! Don't forget to relax during holidays. |
replace snprintf with a C++98 equivalent
|
Thanks @eelstork ! |
snprintfis not consistently available on Windows.Although patchy support is possible (search snprintf in suggested reference), I find that
snprintfmay be advantageously replaced by a solution which doesn't involve defining arbitrarily sized buffers and converting between C and C++ strings.As I understand that C++ streams are not very popular and the main use of
snprintfin Caffe is producing numbered batches, I suggest the introduction of a utility function (format_int).