gustavonihei opened a new pull request, #8397:
URL: https://github.com/apache/nuttx/pull/8397

   ## Summary
   This PR intends to add `MIN`/`MAX` definitions to `sys/param.h`.
   Currently these macros are widespread across several source files, sometimes 
including error-prone behavior like this one:
   
https://github.com/apache/nuttx/blob/1a22487abda3128e9cce6392df38ca42460224dc/arch/arm/src/s32k3xx/s32k3xx_mpuinit.c#L40-L46
   
   Even if not standardized, other OSes and C library implementations also 
define these macros in `sys/param.h`:
   - 
https://github.com/openbsd/src/blob/2edb3e9c42fdbef850415967e487549ca8eb0074/sys/sys/param.h#L191-L193
   - 
https://opensource.apple.com/source/xnu/xnu-201/bsd/sys/param.h.auto.html#:~:text=/*%20Macros%20for%20min/max.%20*/
   - 
https://sourceware.org/git/?p=glibc.git;a=blob;f=misc/sys/param.h;h=76a6a273fd81ed0cba39309ee7fff80e66b6f131;hb=refs/heads/master#l101
   - https://git.musl-libc.org/cgit/musl/tree/include/sys/param.h#n18
   
   ## Impact
   No impact at first, the macros from `sys/param.h` won't override existing 
ones.
   
   ## Testing
   CI build pass.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to