File tree Expand file tree Collapse file tree 13 files changed +34
-10
lines changed
bt/host/bluedroid/btc/profile/std/a2dp
esp_driver_uart/include/driver Expand file tree Collapse file tree 13 files changed +34
-10
lines changed Original file line number Diff line number Diff line change 2222 * BTC.
2323 *
2424 ******************************************************************************/
25+ #include "esp_attr.h"
2526#include "string.h"
2627#include "common/bt_target.h"
2728#include "stack/a2d_api.h"
6667#define BTA_AV_CO_SBC_MAX_BITPOOL 53
6768
6869/* SCMS-T protect info */
69- const UINT8 bta_av_co_cp_scmst [BTA_AV_CP_INFO_LEN ] = "\x02\x02\x00" ;
70+ const UINT8 bta_av_co_cp_scmst [BTA_AV_CP_INFO_LEN ] = { 2 , 2 , 0 } ;
7071
7172/* SBC SRC codec capabilities */
7273const tA2D_SBC_CIE bta_av_co_sbc_caps = {
Original file line number Diff line number Diff line change @@ -161,6 +161,13 @@ extern "C" {
161161// Forces to not inline function
162162#define NOINLINE_ATTR __attribute__((noinline))
163163
164+ #if !defined(__clang__ ) && __GNUC__ >= 15
165+ // Marks a character array as not null-terminated to avoid string-related optimizations or warnings
166+ #define NONSTRING_ATTR __attribute__ ((nonstring))
167+ #else
168+ #define NONSTRING_ATTR
169+ #endif
170+
164171// This allows using enum as flags in C++
165172// Format: FLAG_ATTR(flag_enum_t)
166173#ifdef __cplusplus
Original file line number Diff line number Diff line change 77#pragma once
88
99#include "esp_err.h"
10+ #include "esp_attr.h"
1011#include "soc/soc_caps.h"
1112#include "hal/uart_types.h"
1213
@@ -45,7 +46,7 @@ typedef struct {
4546 '*' represents any symbol.
4647 The end character cannot be '*'.
4748 Example: "he**o" matches hello, heyyo. */
48- char wake_chars_seq [SOC_UART_WAKEUP_CHARS_SEQ_MAX_LEN ];
49+ NONSTRING_ATTR char wake_chars_seq [SOC_UART_WAKEUP_CHARS_SEQ_MAX_LEN ];
4950#endif
5051
5152} uart_wakeup_cfg_t ;
Original file line number Diff line number Diff line change 77#ifndef PHY_INIT_DATA_H
88#define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */
99#include "esp_phy_init.h"
10+ #include "esp_attr.h"
1011#include "sdkconfig.h"
1112
1213#ifdef __cplusplus
@@ -50,7 +51,7 @@ typedef struct {
5051 * @brief Country corresponds to PHY init data type structure
5152 */
5253typedef struct {
53- char cc [PHY_COUNTRY_CODE_LEN ];
54+ NONSTRING_ATTR char cc [PHY_COUNTRY_CODE_LEN ];
5455 uint8_t type ;
5556} phy_country_to_bin_type_t ;
5657#endif
Original file line number Diff line number Diff line change 77#ifndef PHY_INIT_DATA_H
88#define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */
99#include "esp_phy_init.h"
10+ #include "esp_attr.h"
1011#include "sdkconfig.h"
1112
1213#ifdef __cplusplus
@@ -51,7 +52,7 @@ typedef struct {
5152 * @brief Country corresponds to PHY init data type structure
5253 */
5354typedef struct {
54- char cc [PHY_COUNTRY_CODE_LEN ];
55+ NONSTRING_ATTR char cc [PHY_COUNTRY_CODE_LEN ];
5556 uint8_t type ;
5657} phy_country_to_bin_type_t ;
5758#endif
Original file line number Diff line number Diff line change 77#ifndef PHY_INIT_DATA_H
88#define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */
99#include "esp_phy_init.h"
10+ #include "esp_attr.h"
1011#include "sdkconfig.h"
1112
1213#ifdef __cplusplus
@@ -51,7 +52,7 @@ typedef struct {
5152 * @brief Country corresponds to PHY init data type structure
5253 */
5354typedef struct {
54- char cc [PHY_COUNTRY_CODE_LEN ];
55+ NONSTRING_ATTR char cc [PHY_COUNTRY_CODE_LEN ];
5556 uint8_t type ;
5657} phy_country_to_bin_type_t ;
5758#endif
Original file line number Diff line number Diff line change 77#ifndef PHY_INIT_DATA_H
88#define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */
99#include <stdint.h>
10+ #include "esp_attr.h"
1011#include "esp_phy_init.h"
1112#include "sdkconfig.h"
1213
@@ -52,7 +53,7 @@ typedef struct {
5253 * @brief Country corresponds to PHY init data type structure
5354 */
5455typedef struct {
55- char cc [PHY_COUNTRY_CODE_LEN ];
56+ NONSTRING_ATTR char cc [PHY_COUNTRY_CODE_LEN ];
5657 uint8_t type ;
5758} phy_country_to_bin_type_t ;
5859#endif
Original file line number Diff line number Diff line change 77#ifndef PHY_INIT_DATA_H
88#define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */
99#include "esp_phy_init.h"
10+ #include "esp_attr.h"
1011#include "sdkconfig.h"
1112
1213#ifdef __cplusplus
@@ -51,7 +52,7 @@ typedef struct {
5152 * @brief Country corresponds to PHY init data type structure
5253 */
5354typedef struct {
54- char cc [PHY_COUNTRY_CODE_LEN ];
55+ NONSTRING_ATTR char cc [PHY_COUNTRY_CODE_LEN ];
5556 uint8_t type ;
5657} phy_country_to_bin_type_t ;
5758#endif
Original file line number Diff line number Diff line change 88#define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */
99#include <stdint.h>
1010#include "esp_phy_init.h"
11+ #include "esp_attr.h"
1112#include "sdkconfig.h"
1213
1314#ifdef __cplusplus
@@ -52,7 +53,7 @@ typedef struct {
5253 * @brief Country corresponds to PHY init data type structure
5354 */
5455typedef struct {
55- char cc [PHY_COUNTRY_CODE_LEN ];
56+ NONSTRING_ATTR char cc [PHY_COUNTRY_CODE_LEN ];
5657 uint8_t type ;
5758} phy_country_to_bin_type_t ;
5859#endif
Original file line number Diff line number Diff line change 77#ifndef PHY_INIT_DATA_H
88#define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */
99#include "esp_phy_init.h"
10+ #include "esp_attr.h"
1011#include "sdkconfig.h"
1112
1213#ifdef __cplusplus
@@ -51,7 +52,7 @@ typedef struct {
5152 * @brief Country corresponds to PHY init data type structure
5253 */
5354typedef struct {
54- char cc [PHY_COUNTRY_CODE_LEN ];
55+ NONSTRING_ATTR char cc [PHY_COUNTRY_CODE_LEN ];
5556 uint8_t type ;
5657} phy_country_to_bin_type_t ;
5758#endif
You can’t perform that action at this time.
0 commit comments