mirror of
https://github.com/esphome/esphome.git
synced 2026-05-30 07:16:11 +08:00
[ci] Soft-deprecate str_sprintf/str_snprintf to prevent hidden heap allocations
This commit is contained in:
+5
-1
@@ -690,6 +690,8 @@ HEAP_ALLOCATING_HELPERS = {
|
|||||||
"str_truncate": "removal (function is unused)",
|
"str_truncate": "removal (function is unused)",
|
||||||
"str_upper_case": "removal (function is unused)",
|
"str_upper_case": "removal (function is unused)",
|
||||||
"str_snake_case": "removal (function is unused)",
|
"str_snake_case": "removal (function is unused)",
|
||||||
|
"str_sprintf": "snprintf() with a stack buffer",
|
||||||
|
"str_snprintf": "snprintf() with a stack buffer",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -706,7 +708,9 @@ HEAP_ALLOCATING_HELPERS = {
|
|||||||
r"get_mac_address(?!_)|"
|
r"get_mac_address(?!_)|"
|
||||||
r"str_truncate|"
|
r"str_truncate|"
|
||||||
r"str_upper_case|"
|
r"str_upper_case|"
|
||||||
r"str_snake_case"
|
r"str_snake_case|"
|
||||||
|
r"str_sprintf|"
|
||||||
|
r"str_snprintf"
|
||||||
r")\s*\(" + CPP_RE_EOL,
|
r")\s*\(" + CPP_RE_EOL,
|
||||||
include=cpp_include,
|
include=cpp_include,
|
||||||
exclude=[
|
exclude=[
|
||||||
|
|||||||
Reference in New Issue
Block a user