summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2024-09-22 12:56:40 -0400
committerMeco Man <[email protected]>2024-09-22 18:25:47 -0400
commitcee64a41a4b2f26284bf3a73b137c3e88c65fc40 (patch)
tree3e83e310e38b40cac18a076f01d50292059d8123
parent5ec20c4289ff0e4daeb2f0227088f803c3c2294b (diff)
[klibc] format comments after #9459
-rw-r--r--src/klibc/kstdio.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/klibc/kstdio.c b/src/klibc/kstdio.c
index 879a938b6a..851b1008dd 100644
--- a/src/klibc/kstdio.c
+++ b/src/klibc/kstdio.c
@@ -287,11 +287,12 @@ static char *print_number(char *buf,
return buf;
}
-#if defined(__GNUC__) && (__GNUC__ >= 7) && !defined(__ARMCC_VERSION) /* GCC */
+#if (defined(__GNUC__) && !defined(__ARMCC_VERSION) /* GCC */) && (__GNUC__ >= 7)
+/* Disable "-Wimplicit-fallthrough" below GNUC V7 */
#pragma GCC diagnostic push
/* ignore warning: this statement may fall through */
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
-#endif /* defined(__GNUC__) && !defined(__ARMCC_VERSION) */
+#endif /* (defined(__GNUC__) && !defined(__ARMCC_VERSION)) && (__GNUC__ >= 7 */
/**
* @brief This function will fill a formatted string to buffer.
*
@@ -617,9 +618,9 @@ rt_weak int rt_vsnprintf(char *buf, rt_size_t size, const char *fmt, va_list arg
return str - buf;
}
RTM_EXPORT(rt_vsnprintf);
-#if defined(__GNUC__) && !defined(__ARMCC_VERSION) /* GCC */
+#if (defined(__GNUC__) && !defined(__ARMCC_VERSION) /* GCC */) && (__GNUC__ >= 7)
#pragma GCC diagnostic pop /* ignored "-Wimplicit-fallthrough" */
-#endif /* defined(__GNUC__) && !defined(__ARMCC_VERSION) */
+#endif /* (defined(__GNUC__) && !defined(__ARMCC_VERSION)) && (__GNUC__ >= 7 */
/**
* @brief This function will fill a formatted string to buffer.