- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.2k
cbprintf: miscellanous cleanup and fixes #31133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            carlescufi
  merged 8 commits into
  zephyrproject-rtos:master
from
pabigot:nordic/20210106c
  
      
      
   
  Jan 7, 2021 
      
    
                
     Merged
            
            cbprintf: miscellanous cleanup and fixes #31133
                    carlescufi
  merged 8 commits into
  zephyrproject-rtos:master
from
pabigot:nordic/20210106c
  
      
      
   
  Jan 7, 2021 
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    Replace SANITYCHECK flag with TWISTER. Signed-off-by: Peter Bigot <[email protected]>
TC_PRINTF doesn't append a newline, so the skip messages sometimes ran into the test result message. Signed-off-by: Peter Bigot <[email protected]>
checkpatch wants parameters to IS_ENABLED() to be Kconfig constants, i.e. ones that start with CONFIG_. Avoid the whinage. Signed-off-by: Peter Bigot <[email protected]>
Providing a literal width or precision that exceeds the non-negative range of int does not appear to be rejected by the standard, but it does produce a build diagnostic so we can't test it. Switch to an equivalent form that doesn't affect line coverage. Signed-off-by: Peter Bigot <[email protected]>
This function was designed to support the logging infrastructure's need to copy values from va_list structures. It did not meet that need, since some values need to be changed based on additional data that is only available when the complete format specification is examined. Remove the function as unnecessary. Signed-off-by: Peter Bigot <[email protected]>
It may not be clear that the length modifiers reference native C types with specific ranks. Document the core type for each modifier. Signed-off-by: Peter Bigot <[email protected]>
Whether char is signed or unsigned is toolchain and target specific. Rather than assume it's signed (which is true for x86, but not for ARM), do the right thing based on whether the minimum representable value is less than zero. Signed-off-by: Peter Bigot <[email protected]>
              
                    MaureenHelm
  
              
              approved these changes
              
                  
                    Jan 6, 2021 
                  
              
              
            
            
2083477    to
    9279aff      
    Compare
  
    The l length modifier can apply to the c format specifier; in that case the expected value is of type wint_t. Minimal libc doesn't define wint_t, and it is complex to do so correctly (must add <wchar.h>, and use a lot of conditional tricks). wint_t can differ from wchar_t in rank when wchar_t undergoes default integral promotion, which it does on xtensa (wchar_t is unsigned short). So we can use wchar_t as an approximation, except in va_arg where we need to use a wider type: int covers this case. Note that we still don't format wide characters, but we do want to consume the correct amount of data for a default-promoted extended character. Signed-off-by: Peter Bigot <[email protected]>
9279aff    to
    1da2455      
    Compare
  
    
              
                    nashif
  
              
              approved these changes
              
                  
                    Jan 7, 2021 
                  
              
              
            
            
              
                    npitre
  
              
              approved these changes
              
                  
                    Jan 7, 2021 
                  
              
              
            
            
              
                    nordic-krch
  
              
              approved these changes
              
                  
                    Jan 7, 2021 
                  
              
              
            
            
              
                    carlescufi
  
              
              approved these changes
              
                  
                    Jan 7, 2021 
                  
              
              
            
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      Labels
      
    area: API
  Changes to public APIs 
  
    area: Tests
  Issues related to a particular existing or missing test 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Commits extracted from ongoing work in #30675 and #31102 that are independent of packed formatting.