Skip to content

Conversation

@Fix-Point
Copy link
Contributor

Summary

This pull request consists of a series of commits primarily focused on improving code quality, enhancing type safety, addressing compilation warnings, and ensuring compliance with MISRA-C coding standards across various subsystems of the NuttX operating system.

Impact

  • Users (Application Developers): The changes are largely internal and should not affect the functional behavior or the public POSIX API for applications (e.g., timer_create, sem_wait, clock_gettime). The primary user-facing impact is increased code reliability and stability due to stricter type checking and error handling.
  • Code Quality and Maintenance: By addressing MISRA-C violations and eliminating compiler warnings, the codebase becomes more portable, predictable, and easier to maintain. The refactoring in the timer subsystem (removing early returns, simplifying logic) improves readability and reduces the risk of latent bugs.
  • Compatibility: The modifications maintain backward source compatibility. However, developers who directly relied on the internal nxclock_settime() symbol will need to adapt, as it has been removed.
  • Documentation: No direct impact on external documentation. The inline comments within the code are updated to reflect some of the logic changes.
  • Security: While not a direct security patch, the overall hardening (e.g., stricter input validation) contributes to the system's robustness against potential misuse.

Test

Tested on rv-virt:smp, ostest passed.

@github-actions github-actions bot added Arch: x86_64 Issues related to the x86_64 architecture Area: File System File System issues Area: OS Components OS Components issues Size: L The size of the change in this PR is large labels Jan 21, 2026
@Fix-Point Fix-Point force-pushed the upstreaming_2026_01_19 branch from 8323a6e to 7a8855a Compare January 21, 2026 12:22
Gary-Hobson and others added 11 commits January 21, 2026 21:21
FOREACH_ARG Add parameter field.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Adjust the definition and fix CONCATENATE.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
… unit

Fix for MISRA-C rule 8.10

Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
Fix MISRA 2004 rule 10.1 implicit type conversion

Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
Fix timer multiple return.

Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
Fix MISRA Rule 10.4 convert signed variabled to unsigned ones.

Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
Remove CONFIG_DEBUG_FEATURES to check illegal abstime.

Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
Fix MISRA Rule 10.3 exist clock to sclock cause wide type implicit conversion to narrow type, NSEC_PER_USEC to l

Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
vela caros CI compilation error: 'stop' may be used uninitialized in this function.

Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
keep type of constants as ul add clock_t cast to tick relate macro.

Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
This commit fixed a compilation error about the undefined sizeof(struct tls_info_s).

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
@Fix-Point Fix-Point force-pushed the upstreaming_2026_01_19 branch from 7a8855a to 2229581 Compare January 21, 2026 13:21
@acassis
Copy link
Contributor

acassis commented Jan 21, 2026

@Fix-Point seems like we defined a symbol that is defined in nimble:

/github/workspace/sources/apps/wireless/bluetooth/nimble/mynewt-nimble/nimble/host/src/ble_gatts_lcl.c:95: error: "STRINGIFY" redefined [-Werror]

@acassis
Copy link
Contributor

acassis commented Jan 21, 2026

@simbit18 any idea why we are getting this error only now? This symbol was defined many years ago: #14187

Maybe the issue came from some recent modification to nimble?

@simbit18
Copy link
Contributor

simbit18 commented Jan 21, 2026

Hi @acassis I think it's related to some recent changes.

This is also present in the msvc job.( is linked to this change ‎include/nuttx/macro.h )

====================================================================================
Configuration/Tool: sim\windows
2026-01-21 13:29:33
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Select HOST_WINDOWS=y
  Select WINDOWS_NATIVE=y
   TOOLS_DIR path is "D:/a/nuttx/nuttx/sources/nuttx"
   HOST = WINDOWS NATIVE
  CMake configuration completed successfully.
  Building NuttX...
MSBuild version 17.14.23+b0019275e for .NET Framework

  1>Checking Build System
  Building Custom Rule D:/a/nuttx/nuttx/sources/nuttx/CMakeLists.txt
  Building Custom Rule D:/a/nuttx/nuttx/sources/nuttx/CMakeLists.txt
  Building Custom Rule D:/a/nuttx/nuttx/sources/nuttx/CMakeLists.txt
cl : command line  warning D9002: ignoring unknown option '-fvisibility=default' [D:\a\nuttx\nuttx\sources\nuttx\build\sim_head.vcxproj]
  sim_head.c
  sim_doirq.c
  Generating Code...
D:\a\nuttx\nuttx\sources\nuttx\include\nuttx\macro.h(54,18): error C2010: '.': unexpected in macro parameter list [D:\a\nuttx\nuttx\sources\nuttx\build\sim_head.vcxproj]
  (compiling source file '../arch/sim/src/sim/sim_head.c')
  
D:\a\nuttx\nuttx\sources\nuttx\include\nuttx\macro.h(55,17): error C2010: '.': unexpected in macro parameter list [D:\a\nuttx\nuttx\sources\nuttx\build\sim_head.vcxproj]
  (compiling source file '../arch/sim/src/sim/sim_head.c')
  
D:\a\nuttx\nuttx\sources\nuttx\include\nuttx\macro.h(54,18): error C2010: '.': unexpected in macro parameter list [D:\a\nuttx\nuttx\sources\nuttx\build\sim_head.vcxproj]
  (compiling source file '../arch/sim/src/sim/sim_doirq.c')
  
D:\a\nuttx\nuttx\sources\nuttx\include\nuttx\macro.h(55,17): error C2010: '.': unexpected in macro parameter list [D:\a\nuttx\nuttx\sources\nuttx\build\sim_head.vcxproj]
  (compiling source file '../arch/sim/src/sim/sim_doirq.c')
  
  An error occurred while copying files: Cannot find path 'D:\a\nuttx\nuttx\sources\nuttx\build\Debug\nuttx.exe' because it does not exist.
  Refresh completed successfully.
------------------------------------------------------------------------------------
End: 2026-01-21 13:30:14
====================================================================================
Error: Process completed with exit code 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: x86_64 Issues related to the x86_64 architecture Area: File System File System issues Area: OS Components OS Components issues Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants