From ebb8e8dfc6c0b902227c78b82819db060268eb63 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Tue, 15 Apr 2025 21:51:30 +0000 Subject: logger.h: de-duplicate __attribute__(__format__(..)) ifdefs Squashed with: * Rename - it's member shift, not printf shift * So it seems that CILK PLUS either ignores the this argument of member functions or already considers it on its own. Besides.. is CILK PLUS even relevant today? Whatever.. Plus, deduplicate some more functions ..should this attribute be moved to its own file? * Correct indents * logger.h: de-duplicate __attribute__(__format__(..)) **** mana/plus!163 --- src/utils/stringutils.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/utils/stringutils.h') diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h index b5eca16ab..6d33c3830 100644 --- a/src/utils/stringutils.h +++ b/src/utils/stringutils.h @@ -100,15 +100,10 @@ const char *ipToString(const uint32_t address) A_WARN_UNUSED; /** * A safe version of sprintf that returns a std::string of the result. */ -std::string strprintf(const char *const format, ...) A_NONNULL(1) A_WARN_UNUSED -#ifdef __GNUC__ -#ifdef __OpenBSD__ - __attribute__((__format__(printf, 1, 2))) -#else // __OpenBSD__ - __attribute__((__format__(gnu_printf, 1, 2))) -#endif // __OpenBSD__ -#endif // __GNUC__ -; +std::string strprintf(const char *const format, ...) + A_NONNULL(1) + A_WARN_UNUSED + A_FORMAT_PRINTF(false, 1, 2); /** * Removes colors from a string -- cgit v1.2.3-70-g09d2