[Openmp-commits] [PATCH] D108196: [OpenMP] Fix the usage of sscanf on MinGW

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


mstorsjo created this revision.
mstorsjo added reviewers: jlpeyton, AndreyChurbanov.
Herald added subscribers: guansong, yaxunl.
mstorsjo requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.
Herald added a project: OpenMP.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108196

Files:
  openmp/runtime/src/kmp_settings.cpp


Index: openmp/runtime/src/kmp_settings.cpp
===================================================================
--- openmp/runtime/src/kmp_settings.cpp
+++ openmp/runtime/src/kmp_settings.cpp
@@ -164,7 +164,7 @@
     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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108196.366848.patch
Type: text/x-patch
Size: 492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210817/be46b5b4/attachment.bin>


More information about the Openmp-commits mailing list