Junbo-Zheng opened a new pull request, #20110:
URL: https://github.com/apache/nuttx/pull/20110

   ## Summary
   
   `nuttx_parse_function_args()` declares `FUNC` as its one-value keyword, so 
the parsed variable is `IN_FUNC`. However, both `FATAL_ERROR` messages 
referenced a never-defined `${IN_NAME}`, which always expands to an empty 
string. As a result, every argument-misuse diagnostic of every wrapper built on 
this parser printed an empty function name, and the user had no way to tell 
which function rejected the arguments. Reference `IN_FUNC` instead.
   
   ## Impact
   
   - **Users**: None -- error-message-only change; no behavior change on any 
successful configure path.
   - **Build**: None -- the parse logic itself is untouched.
   - **Hardware**: None.
   - **Documentation**: None.
   - **Security & Compatibility**: None.
   
   ## Testing
   
   Called a wrapper of `nuttx_parse_function_args()` with a bad keyword and 
with a missing required argument via `cmake -P` on Ubuntu 22.04:
   
   Before:
   CMake Error at cmake/nuttx_parse_function_args.cmake:76 (message):
   ```
     : unparsed WRONG;x
   ```
   After:
   CMake Error at cmake/nuttx_parse_function_args.cmake:76 (message):
   ```
     myfunc: unparsed WRONG;x
   ```
   CMake Error at cmake/nuttx_parse_function_args.cmake:82 (message):
   ```
     myfunc requires argument MODE
   ```
   Both error paths now identify the calling function.
   
   Signed-off-by: Junbo Zheng 
<[[email protected]](mailto:[email protected])>


-- 
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