BCatalog: declare GetString as format_printf function
This tells the compiler that this function takes a format string as a parameter, and returns a "similar" string with the same formatting operations. This allows the format string to "propagate" to prinf-file functions (including BString::SetToFormat) and the format string to be actually checked with the arguments passed to that function. Without this, all translated strings were not checked to match with their arguments. Change-Id: I5c3c5cbfe7dfede9a6f45cad47a7524f9138fac0 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7663 Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk> Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org> Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
7eab6b486e
commit
7d5b913b51
|
@ -31,7 +31,8 @@ public:
|
|||
|
||||
const char* GetString(const char* string,
|
||||
const char* context = NULL,
|
||||
const char* comment = NULL);
|
||||
const char* comment = NULL)
|
||||
__attribute__((format_arg(2)));
|
||||
const char* GetString(uint32 id);
|
||||
|
||||
status_t GetData(const char* name, BMessage* msg);
|
||||
|
|
Loading…
Reference in New Issue