Skip to content

Commit

Permalink
[OpenMP] Fix the usage of sscanf on MinGW
Browse files Browse the repository at this point in the history
KMP_SSCANF only evaluates to sscanf_s within
    #if KMP_OS_WINDOWS && KMP_MSVC_COMPAT
so we need to pass the sscanf_s specific parameters within a similar
condition.

Differential Revision: https://reviews.llvm.org/D108196
  • Loading branch information
mstorsjo committed Aug 17, 2021
1 parent 18e06e3 commit f5616a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openmp/runtime/src/kmp_settings.cpp
Expand Up @@ -164,7 +164,7 @@ int __kmp_convert_to_milliseconds(char const *data) {
return (INT_MAX);
value = (double)0.0;
mult = '\0';
#if KMP_OS_WINDOWS
#if KMP_OS_WINDOWS && KMP_MSVC_COMPAT
// On Windows, each %c parameter needs additional size parameter for sscanf_s
nvalues = KMP_SSCANF(data, "%lf%c%c", &value, &mult, 1, &extra, 1);
#else
Expand Down

0 comments on commit f5616a9

Please sign in to comment.