RT-Thread / RT-Thread/rt-thread

[Bug] nano版本编译提示 error: #20: identifier "va_list" is undefined

Open
#9,748 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
12.2k
Forks
5.4k
Avg merge
4d 12h
Merged PRs (30d)
40

Description

RT-Thread Version

nano, master

Hardware Type/Architectures

cortex M0

Develop Toolchain

MDK Keil

Describe the bug
  1. 在源码基础上,按照nano移植方法移植。
  2. 移植完编译提示 error: #20: identifier "va_list" is undefined
  3. 原因是未包含<stdarg.h>,解决方案之一是在rtconfig.h 中 #define RT_USING_LIBC。正常应该是不需要定义这个宏
  4. 在rtdef.h中源码如下:
  5. #ifdef RT_USING_LIBC
    #include <stdint.h>
    #include <stddef.h>
    #include <stdarg.h>
Other additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with rtdef.h and rtconfig.h in the nano configuration, then reproduce the Cortex-M0 build using MDK Keil. Check how va_list is made available when RT_USING_LIBC is not defined. Done means the nano source compiles without requiring that workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system, embedded-iot, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.