[Openmp-commits] [PATCH] D137543: [Support] Add missing <cstdint> header to common.h

Xi Ruoyao via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 7 05:22:12 PST 2022


xry111 added inline comments.


================
Comment at: openmp/runtime/test/tasking/hidden_helper_task/common.h:9
 
 using kmp_int32 = int32_t;
 using kmp_int64 = int64_t;
----------------
Technically these should be `std::int32_t`, etc.  From the C++ standard:

```
All library entities except operator new and operator delete are defined within the namespace std or
namespaces nested within namespace std. (footnote 166)

166) The C standard library headers (Annex D.5) also define names within the global namespace, while the C++ headers for C
library facilities (20.5.1.2) may also define names within the global namespace.
```

Note that it's a "may", not "must".

This diff is a portability improvement, so I think it's better to "do things correctly now" and add `std::`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137543/new/

https://reviews.llvm.org/D137543



More information about the Openmp-commits mailing list