From 5ba53a5247f0d60665f7f18afb03acd1b2cffa34 Mon Sep 17 00:00:00 2001 From: John Turner Date: Thu, 31 Jul 2025 08:59:36 -0400 Subject: use maybe_unused instead of gnu::unused --- src/pam_xdg.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/pam_xdg.cpp b/src/pam_xdg.cpp index 6b0278c..9f4118e 100644 --- a/src/pam_xdg.cpp +++ b/src/pam_xdg.cpp @@ -28,9 +28,8 @@ void open_db(sqlite3 **db, const std::filesystem::path &path, int flags) { } void init_db(sqlite3 *db) { - auto rc = sqlite3_exec( - db, "CREATE TABLE SESSIONS(USERNAME TEXT, LOGINS INT)", - nullptr, nullptr, nullptr); + auto rc = sqlite3_exec(db, "CREATE TABLE SESSIONS(USERNAME TEXT, LOGINS INT)", + nullptr, nullptr, nullptr); if (rc != SQLITE_OK) { throw std::runtime_error( @@ -223,9 +222,9 @@ void create_directory(const std::filesystem::path &path, std::uint16_t owner, } // namespace pam_xdg extern "C" int pam_sm_open_session(pam_handle_t *pamh, - [[gnu::unused]] int flags, - [[gnu::unused]] int argc, - [[gnu::unused]] const char **argv) { + [[maybe_unused]] int flags, + [[maybe_unused]] int argc, + [[maybe_unused]] const char **argv) { const void *data; if (pam_get_item(pamh, PAM_USER, &data) != PAM_SUCCESS) { @@ -293,9 +292,9 @@ extern "C" int pam_sm_open_session(pam_handle_t *pamh, } extern "C" int pam_sm_close_session(pam_handle_t *pam, - [[gnu::unused]] int flags, - [[gnu::unused]] int argc, - [[gnu::unused]] const char **argv) { + [[maybe_unused]] int flags, + [[maybe_unused]] int argc, + [[maybe_unused]] const char **argv) { const void *data; if (pam_get_item(pam, PAM_USER, &data) != PAM_SUCCESS) { -- cgit v1.2.3