Skip to content

Commit

Permalink
Merge branch 'backport/fix/empty_int_handling' into 'release/v5.0'
Browse files Browse the repository at this point in the history
fix(kconfgen): Improve error message for int/hex without default

See merge request espressif/esp-idf!37215
  • Loading branch information
dobairoland committed Feb 24, 2025
2 parents ae11fd5 + 2c501d5 commit a5099fa
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tools/kconfig_new/confgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
# Used internally by the ESP-IDF build system. But designed to be
# non-IDF-specific.
#
# SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2018-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0

import argparse
import json
import os
import os.path
import re
import sys
Expand Down Expand Up @@ -388,9 +386,17 @@ def write_node(node):
sym = node.item
if not isinstance(sym, kconfiglib.Symbol):
return

if sym.config_string:
val = sym.str_value
if not val and sym.type in (
kconfiglib.INT,
kconfiglib.HEX,
):
print(
f'warning: {sym.name} has no value set in the configuration.'
' This can be caused e.g. by missing default value for the current chip version.'
)
val = None
if sym.orig_type in (kconfiglib.BOOL, kconfiglib.TRISTATE) and val == 'n':
val = '' # write unset values as empty variables
elif sym.orig_type == kconfiglib.STRING:
Expand Down

0 comments on commit a5099fa

Please sign in to comment.