From 9ea63c7fd6eac38d5fb0262073f8de8b7e6438d9 Mon Sep 17 00:00:00 2001 From: Alan Everett Date: Sat, 11 Apr 2026 16:51:58 -0400 Subject: [PATCH] [wpilibc] Return empty string instead of null for GetOpMode (#8754) Clang 21 catches returning `0` from `GetOpMode` as returning `null`. Since this state is very momentary and all comparisons inside WPILib are done against `GetOpModeId` instead, I changed it to return an empty string. --- wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp b/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp index ed95c0b252..ecc01c1f64 100644 --- a/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp +++ b/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp @@ -695,7 +695,7 @@ int64_t DriverStation::GetOpModeId() { std::string DriverStation::GetOpMode() { if (!::GetInstance().userProgramStarted) { - return 0; + return ""; } return GetInstance().OpModeToString(GetOpModeId());