[Openmp-commits] [openmp] [OpenMP] Fix set-but-unused-var warning in omptest (PR #196069)
Robert Imschweiler via Openmp-commits
openmp-commits at lists.llvm.org
Thu May 7 01:58:09 PDT 2026
================
@@ -0,0 +1,38 @@
+//===- EnvHelper.h - General logging class ----------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Provides environment helpers shared between a couple of places.
+///
+//===----------------------------------------------------------------------===//
+
+#include <optional>
+
+#ifndef OPENMP_TOOLS_OMPTEST_INCLUDE_ENVHELPER_H
+#define OPENMP_TOOLS_OMPTEST_INCLUDE_ENVHELPER_H
+
+namespace omptest {
+/// Load the value of a given boolean environmental variable. Return
+/// std::nullopt if not specified in the environment.
+inline std::optional<bool>
----------------
ro-i wrote:
yeah, but the default value is always false. But since that's only true at the moment and could change any time, ig it's a good idea to have three return values
https://github.com/llvm/llvm-project/pull/196069
More information about the Openmp-commits
mailing list