[Openmp-commits] [PATCH] D32490: [OpenMP] Add missing parenthesis which triggers a compile error

George Rokos via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Apr 25 08:23:28 PDT 2017


grokos created this revision.
grokos added a project: OpenMP.
Herald added a subscriber: rengolin.

Compiling with `-Werror` triggers an error due to a missing pair of parentheses:

`error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]`


Repository:
  rL LLVM

https://reviews.llvm.org/D32490

Files:
  runtime/src/kmp_settings.cpp


Index: runtime/src/kmp_settings.cpp
===================================================================
--- runtime/src/kmp_settings.cpp
+++ runtime/src/kmp_settings.cpp
@@ -4353,7 +4353,7 @@
   // Split by delimiter
   pos = input;
   components[level++] = pos;
-  while (pos = strchr(pos, ',')) {
+  while ((pos = strchr(pos, ','))) {
     *pos = '\0'; // modify input and avoid more copying
     components[level++] = ++pos; // expect something after ","
     if (level > MAX_T_LEVEL)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32490.96569.patch
Type: text/x-patch
Size: 488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20170425/166537b8/attachment.bin>


More information about the Openmp-commits mailing list