[Openmp-commits] [openmp] f5616a9 - [OpenMP] Fix the usage of sscanf on MinGW

Martin Storsjö via Openmp-commits openmp-commits at lists.llvm.org
Tue Aug 17 11:36:34 PDT 2021


Author: Martin Storsjö
Date: 2021-08-17T21:36:09+03:00
New Revision: f5616a981c60c619393c92d6180f128e934a36c9

URL: https://github.com/llvm/llvm-project/commit/f5616a981c60c619393c92d6180f128e934a36c9
DIFF: https://github.com/llvm/llvm-project/commit/f5616a981c60c619393c92d6180f128e934a36c9.diff

LOG: [OpenMP] Fix the usage of sscanf on MinGW

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

Added: 
    

Modified: 
    openmp/runtime/src/kmp_settings.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/kmp_settings.cpp b/openmp/runtime/src/kmp_settings.cpp
index 348087278345..b0a045dc4eb9 100644
--- a/openmp/runtime/src/kmp_settings.cpp
+++ b/openmp/runtime/src/kmp_settings.cpp
@@ -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


        


More information about the Openmp-commits mailing list