[Openmp-commits] [PATCH] D51226: [OpenMP][libomptarget] rework of fatal error reporting

Alexandre Eichenberger via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Aug 27 08:10:21 PDT 2018


AlexEichenberger added inline comments.


================
Comment at: libomptarget/src/private.h:53
+    exit(1);                                                          \
+  }
+
----------------
Hahnfeld wrote:
> Hahnfeld wrote:
> > Hahnfeld wrote:
> > > If anything please use the `do { ... } while (0)` logic, that's actually a good thing for macros: https://stackoverflow.com/a/1067238
> > Ping!
> `do { ... } while (0)` wasn't a typo, please see the link.
> 
>  * Please remove the outer compound statement (`{ ... }`).
>  * Change `while (1)` to `while (0)`. The idea is not to make that an infinite loop (which it is not in this case because of the `exit()`) but to require a semicolon after "invoking" the macro.
>  * Hence remove the final `;`, that needs to be at the call site.
changed


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D51226





More information about the Openmp-commits mailing list