You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/24 19:47:10 UTC

[GitHub] [incubator-nuttx] hartmannathan commented on pull request #3169: arch/stm32h7 - Fix compiler warnings and error in stm32_dma.c

hartmannathan commented on pull request #3169:
URL: https://github.com/apache/incubator-nuttx/pull/3169#issuecomment-806125075


   > @hartmannathan
   > 
   > I have seen a lot of fixes for this class of error using different approaches. @patacongo mentioned the conical form as you have used here in. I was trying to discern the correct pattern and if it is divided on a common OS and arch driver boundary or are we just not being consistent and should ask for changes on PRs.
   
   I don't really know the answer to that; on one hand if we know that, e.g., uint32_t needs "%lu" for a particular arch, then we _could_ use that, but then it will likely be copied-and-pasted into code for other arches. Using the PRIu32 et al for these is (IMO) makes the code a little harder to grok but seems to be the safest approach as the code will DTRT for any arch. Doing nothing and leaving the format specifiers as they are now is raising a lot of compiler warnings since the build system is set up that way since some months ago. I fixed this file today because my build started throwing warnings as soon as I enabled DMA in Kconfig.
   
   > 
   > To that end, do you feel we should add an explicit `#include <inttypes.h>` to these files?
   
   My bad, I meant to include inttypes.h but forgot. I do think it should be there explicitly; do you agree? If so, I'll add it.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org