[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

Jonathon Penix via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 26 12:27:19 PDT 2022


jpenix-quic added inline comments.


================
Comment at: flang/runtime/environment-default-list.h:1
+//===-- Runtime/environment-default-list.h --------------------------------===//
+//
----------------
klausler wrote:
> If you want this header to be maximally portable C and C++, please observe the usage of other such headers, and use old-school C /*comments*/.
> 
> You could probably just use an 'int' for the item count and avoid some difficulty below, unless you expect a program to use billions of default environment settings.
Done re: using an int!

Just to double check regarding C/C++ portability and looking at other headers, one that I was looking at was Decimal/decimal.h and the structs, etc. in that file are conditionally added to namespaces depending on whether it is C or C++. I was waffling on whether I should be doing that here though (I am not currently/was not previously) as keeping the type out of the namespace allows me to keep a consistent type/directly pass the pointer from Fortran_main.c to main.cpp/enviornment.cpp. But, as a result I'm also polluting the default namespace with EnvironmentDefaultList/Item for C++ code. Is how I have it currently ok, or would it be better to move the structs into namespaces for C++ and just cast to the correct type along the way? (Or, is there another option I am missing?)


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

https://reviews.llvm.org/D130513



More information about the cfe-commits mailing list