mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
LibC: Deprecate strcpy(), strncpy(), strcat() and strncat() :^)
And also mark strlcpy() and strlcat() with __attribute__((warn_unused_result)). Since our code is warning-free, this ensures we never misuse those functions. (Or are very sure about doing it when turning off the warning for a particular piece of code.)
This commit is contained in:
parent
0106647ab8
commit
f808810d00
3 changed files with 25 additions and 3 deletions
|
@ -95,6 +95,11 @@ static void ensure_caps()
|
|||
caps->set("li", "25");
|
||||
}
|
||||
|
||||
// Unfortunately, tgetstr() doesn't accept a size argument for the buffer
|
||||
// pointed to by area, so we have to use bare strcpy().
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
char* tgetstr(const char* id, char** area)
|
||||
{
|
||||
ensure_caps();
|
||||
|
@ -113,6 +118,8 @@ char* tgetstr(const char* id, char** area)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
int tgetflag(const char* id)
|
||||
{
|
||||
(void)id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue