This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit d9a5271d6fe32709fe8eaf4abf2d27ce32298f21
Author: pangzhen1 <[email protected]>
AuthorDate: Tue Sep 30 10:31:50 2025 +0800

    stdio: make __FS_FLAG_* stream flag macros unsigned
    
    Fix Coverity: the stream flags in struct file_struct (fs_flags) are
    unsigned, so the flag macros should be unsigned too (MISRA C-2012
    Rule 10.4, no implicit conversion between signed and unsigned operands).
    
    Signed-off-by: pangzhen1 <[email protected]>
---
 include/stdio.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/stdio.h b/include/stdio.h
index 1771e8cc296..e1e9ccf1dbf 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -71,10 +71,10 @@
 
 /* Stream flags for the fs_flags field of in struct file_struct */
 
-#define __FS_FLAG_EOF   (1 << 0) /* EOF detected by a read operation */
-#define __FS_FLAG_ERROR (1 << 1) /* Error detected by any operation */
-#define __FS_FLAG_LBF   (1 << 2) /* Line buffered */
-#define __FS_FLAG_UBF   (1 << 3) /* Buffer allocated by caller of setvbuf */
+#define __FS_FLAG_EOF   (1u << 0) /* EOF detected by a read operation */
+#define __FS_FLAG_ERROR (1u << 1) /* Error detected by any operation */
+#define __FS_FLAG_LBF   (1u << 2) /* Line buffered */
+#define __FS_FLAG_UBF   (1u << 3) /* Buffer allocated by caller of setvbuf */
 
 /* File system error values */
 

Reply via email to