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

   ## Summary
   
   The RTC driver causes the following warning:
   
   ```
   timers/rtc.c: In function ‘rtc_initialize’:
   timers/rtc.c:851:34: warning: ‘%d’ directive output may be truncated writing 
between 1 and 11 bytes into a region of size 8 [-Wformat-truncation=]
     851 |   snprintf(devpath, 16, "/dev/rtc%d", minor);
         |                                  ^~
   timers/rtc.c:851:25: note: directive argument in the range [-2147483648, 999]
     851 |   snprintf(devpath, 16, "/dev/rtc%d", minor);
         |                         ^~~~~~~~~~~~
   timers/rtc.c:851:3: note: ‘snprintf’ output between 10 and 20 bytes into a 
destination of size 16
     851 |   snprintf(devpath, 16, "/dev/rtc%d", minor);
         |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
   ```
   
   This PR fixes this warning.  
   The `devpath` is slightly enlarged, to ensure that all possible numbers can 
be reliably printed.
   
   ## Impact
   
   Practically none.
   
   The buffer is enlarged by just 4 bytes, but it is also located in the stack. 
So it shouldn't have any actual impact on any practical application.
   
   ## Testing
   
   Build test only.


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