[PATCH] D140707: Use a long-established error code instead of a newfangled one which causes portability problems

HÃ¥vard Eidnes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 27 14:38:35 PST 2022


he32 created this revision.
Herald added a subscriber: krytarowski.
Herald added a project: All.
he32 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Use the long-established `operation_not_supported` instead of the rather newfangled `state_not_recoverable` error code.
The latter is not available on NetBSD 9.x, due to the host system not having `ENOTRECOVERABLE`
defined.  NetBSD-current and the coming 10.0 will have it, though.

However, it can also be argued that `operation_not_supported` is a better fit for the actual error message,
which in essence says "Incremental mode for action %d is not supported".


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140707

Files:
  clang/lib/Interpreter/IncrementalParser.cpp


Index: clang/lib/Interpreter/IncrementalParser.cpp
===================================================================
--- clang/lib/Interpreter/IncrementalParser.cpp
+++ clang/lib/Interpreter/IncrementalParser.cpp
@@ -53,7 +53,7 @@
           switch (CI.getFrontendOpts().ProgramAction) {
           default:
             Err = llvm::createStringError(
-                std::errc::state_not_recoverable,
+                std::errc::operation_not_supported,
                 "Driver initialization failed. "
                 "Incremental mode for action %d is not supported",
                 CI.getFrontendOpts().ProgramAction);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140707.485425.patch
Type: text/x-patch
Size: 630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221227/be999d96/attachment.bin>


More information about the cfe-commits mailing list