Skip to content

py/mphal: Add header for size_t. #17783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2025
Merged

Conversation

yf13
Copy link
Contributor

@yf13 yf13 commented Jul 29, 2025

Summary

This adds #include <stddef.h> for definition of size_t to solve compilation issue encountered with NuttX integration:

py/mphal.h:59:50: error: unknown type name 'size_t'
   59 | mp_uint_t mp_hal_stdout_tx_strn(const char *str, size_t len);
      |                                                  ^~~~~~
py/mphal.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'

Testing

Checked with NuttX integration on QEMU riscv.

Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

Copy link

codecov bot commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.39%. Comparing base (d4399b3) to head (ab4af2c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #17783   +/-   ##
=======================================
  Coverage   98.38%   98.39%           
=======================================
  Files         171      171           
  Lines       22257    22257           
=======================================
+ Hits        21898    21899    +1     
+ Misses        359      358    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yf13 yf13 force-pushed the pull-mphal-size_t branch from d5095b5 to ac306ad Compare July 29, 2025 11:39
@yf13 yf13 changed the title py/mphal.h:Include stddef.h. py/mphal.h: Include stddef.h for size_t. Jul 29, 2025
@yf13 yf13 force-pushed the pull-mphal-size_t branch 2 times, most recently from 9feb92d to 37ca4e1 Compare July 29, 2025 11:45
@yf13 yf13 changed the title py/mphal.h: Include stddef.h for size_t. py/mphal.h: Includes def for size_t. Jul 29, 2025
@yf13 yf13 force-pushed the pull-mphal-size_t branch from 37ca4e1 to 596fb59 Compare July 29, 2025 11:46
@yf13 yf13 changed the title py/mphal.h: Includes def for size_t. py/mphal: Add header for size_t. Jul 29, 2025
@yf13 yf13 force-pushed the pull-mphal-size_t branch from 596fb59 to 448f2eb Compare July 29, 2025 11:50
Copy link
Contributor

@projectgus projectgus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @yf13! Seems sensible from an "include what you use" perspective.

@dpgeorge dpgeorge added the py-core Relates to py/ directory in source label Jul 30, 2025
This includes "stddef.h" for `size_t` to resolve NuttX integration build
issues.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
@dpgeorge dpgeorge force-pushed the pull-mphal-size_t branch from 448f2eb to ab4af2c Compare July 30, 2025 01:48
@dpgeorge dpgeorge merged commit ab4af2c into micropython:master Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
py-core Relates to py/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants