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

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


The following commit(s) were added to refs/heads/master by this push:
     new c24e6410 Fix UT compilation errors with GCC 13 due to missing 
<cstdint> includes (#2979)
c24e6410 is described below

commit c24e641009fa0305f0efebce694d0dad886c85ca
Author: Xiaochuan Ye <[email protected]>
AuthorDate: Sun Jun 1 21:10:34 2025 +0800

    Fix UT compilation errors with GCC 13 due to missing <cstdint> includes 
(#2979)
    
    GCC 13 no longer transitively includes <cstdint> from other standard
    library headers. This causes compilation failures for code using types
    like uint32_t and uintptr_t without explicitly including <cstdint>.
    
    This commit adds the missing #include <cstdint> directives to:
    - test/baidu_thread_local_unittest.cpp
    - src/bthread/list_of_abafree_id.h
    
    The errors were:
    - error: 'uintptr_t' was not declared in this scope
    - error: 'uint32_t' does not name a type
    
    This change ensures compatibility with GCC 13 while maintaining
    backward compatibility with older compiler versions.
    
    Reference: https://gcc.gnu.org/gcc-13/porting_to.html
---
 src/bthread/list_of_abafree_id.h     | 2 +-
 test/baidu_thread_local_unittest.cpp | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/bthread/list_of_abafree_id.h b/src/bthread/list_of_abafree_id.h
index 45043acc..16de5b20 100644
--- a/src/bthread/list_of_abafree_id.h
+++ b/src/bthread/list_of_abafree_id.h
@@ -24,7 +24,7 @@
 
 #include <deque>
 #include <vector>
-
+#include <cstdint>
 #include "butil/macros.h"
 
 namespace bthread {
diff --git a/test/baidu_thread_local_unittest.cpp 
b/test/baidu_thread_local_unittest.cpp
index 01209b6b..4cc629f3 100644
--- a/test/baidu_thread_local_unittest.cpp
+++ b/test/baidu_thread_local_unittest.cpp
@@ -17,6 +17,7 @@
 
 #include <gtest/gtest.h>
 #include <errno.h>
+#include <cstdint>
 #include "butil/thread_local.h"
 
 namespace {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to