apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.87k stars 1.17k forks source link

[BUG] sim/segger: stream_rtt.c fails at lib_puts_t `int` vs `long unsigned int` #14796

Open lupyuen opened 6 hours ago

lupyuen commented 6 hours ago

Description / Steps to reproduce the issue

Reported by nuttx-dashboard.org: segger/stream_rtt.c fails to build due to incompatible types in lib_puts_t. segger/stream_rtt.c has not been changed recently. Has the Segger API changed?

https://github.com/NuttX/nuttx/actions/runs/11842046534/job/32999846174#step:7:259

Configuration/Tool: sim/segger
segger/stream_rtt.c: In function 'lib_rttoutstream_open':
Error: segger/stream_rtt.c:137:23: error: assignment to 'lib_puts_t' {aka 'long int (*)(struct lib_outstream_s *, const void *, long unsigned int)'} from incompatible pointer type 'int (*)(struct lib_outstream_s *, const void *, int)' [-Werror=incompatible-pointer-types]
  137 |   stream->common.puts = rttstream_puts;
      |                       ^
segger/stream_rtt.c: In function 'lib_rttinstream_open':
Error: segger/stream_rtt.c:185:23: error: assignment to 'lib_gets_t' {aka 'long int (*)(struct lib_instream_s *, void *, long unsigned int)'} from incompatible pointer type 'int (*)(struct lib_instream_s *, void *, int)' [-Werror=incompatible-pointer-types]
  185 |   stream->common.gets = rttstream_gets;
      |                       ^
cc1: all warnings being treated as errors
make[1]: *** [Makefile:109: segger/stream_rtt.o] Error 1
make[1]: Target 'libdrivers.a' not remade because of errors.
make: *** [tools/LibTargets.mk:107: drivers/libdrivers.a] Error 2

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Ubuntu LTS at GitHub Actions

NuttX Version

master

Issue Architecture

[Arch: simulator]

Issue Area

[Area: Build System]

Verification

xiaoxiang781216 commented 2 hours ago

@jasonbu please look at this problem.