Merge branch 'bugfix/esp_rom_const_correctness' into 'master'

esp_rom: Fixed writable string issue on Linux implementation

Closes IDF-6187

See merge request espressif/esp-idf!20925
This commit is contained in:
Zim Kalinowski 2022-11-04 18:16:33 +08:00
commit 8184f03115
4 changed files with 10 additions and 16 deletions

View File

@ -1,3 +1,4 @@
CONFIG_IDF_TARGET="linux"
CONFIG_COMPILER_CXX_EXCEPTIONS=y
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=n
CONFIG_COMPILER_WARN_WRITE_STRINGS=y

View File

@ -1,16 +1,8 @@
// Copyright 2021 Espressif Systems (Shanghai) CO LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdio.h>
#include <stdlib.h>
@ -30,7 +22,7 @@ static void call_linux_putc(char c) {
#define is_digit(c) ((c >= '0') && (c <= '9'))
static int _cvt(unsigned long long val, char *buf, long radix, char *digits)
static int _cvt(unsigned long long val, char *buf, long radix, const char *digits)
{
#ifdef SUPPORT_LITTLE_RADIX
char temp[64];
@ -65,7 +57,8 @@ static int esp_rom_vprintf(void (*putc)(char c), const char *fmt, va_list ap)
#else
char buf[32];
#endif
char c, sign, *cp=buf;
char c, sign;
const char *cp = buf;
int left_prec, right_prec, zero_fill, pad, pad_on_right,
islong, islonglong;
long long val = 0;

View File

@ -1,5 +1,6 @@
CONFIG_IDF_TARGET="linux"
CONFIG_COMPILER_CXX_EXCEPTIONS=y
CONFIG_COMPILER_WARN_WRITE_STRINGS=y
CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y
CONFIG_LOG_DEFAULT_LEVEL=5

View File

@ -587,7 +587,6 @@ components/esp_rom/include/esp_rom_uart.h
components/esp_rom/include/linux/soc/reset_reasons.h
components/esp_rom/linux/esp_rom_crc.c
components/esp_rom/linux/esp_rom_md5.c
components/esp_rom/linux/esp_rom_sys.c
components/esp_rom/patches/esp_rom_crc.c
components/esp_rom/patches/esp_rom_tjpgd.c
components/esp_rom/test/test_libgcc.c