1
0

fix: fix compile error in gcc.

- remove __attribute__(format) checker for UTF8 char type printf becuase it forcely require the type of format string is const char*, rather than const char8_t*, and I can not use any switches to remove this.
- delete useless macro and header in clap manual.
This commit is contained in:
2025-09-28 22:38:09 +08:00
parent d6be8a11ac
commit 82c3ed5b32
2 changed files with 7 additions and 3 deletions

View File

@ -2,13 +2,11 @@
#include "../termcolor.hpp"
#include "../../patch/stream.hpp"
#include "../../patch/format.hpp"
#include "../../string/op.hpp"
#define CLAP ::yycc::carton::clap
#define TABULATE ::yycc::carton::tabulate
#define TERMCOLOR ::yycc::carton::termcolor
#define FORMAT ::yycc::patch::format
#define OP ::yycc::carton::op
using namespace ::yycc::patch::stream;

View File

@ -12,13 +12,19 @@ namespace yycc::string::op {
#pragma region Printf
// YYC MARK:
// Shitty __attribute__((format(gnu_printf, (A), (B)))) force the type of format string is const char*.
// My function signature will cause compile error which can not be removed by any switches.
// I guess Clang may have same issue.
// So I sadly disable format string check for printf in UTF8 char type.
/**
* @brief Perform an UTF8 string formatting operation.
* @param[in] format The format string.
* @param[in] ... Argument list of format string.
* @return The formatted result.
*/
std::u8string printf(YYCC_PRINTF_CHECK_FMTSTR const char8_t* format, ...) YYCC_PRINTF_CHECK_ATTR(1, 2);
std::u8string printf(/*YYCC_PRINTF_CHECK_FMTSTR*/ const char8_t* format, ...) /*YYCC_PRINTF_CHECK_ATTR(1, 2)*/;
/**
* @brief Perform an UTF8 string formatting operation.
* @param[in] format The format string.