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

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new a45a15c1c porting/linux: Fix warning about __USE_GNU redefinition
a45a15c1c is described below

commit a45a15c1c95237929d251134d4dababf14f658aa
Author: Szymon Janc <[email protected]>
AuthorDate: Thu Oct 31 13:51:37 2024 +0100

    porting/linux: Fix warning about __USE_GNU redefinition
    
    Simply define this before including any systema headers.
    
    g -D_GNU_SOURCE  -o ../../../porting/npl/linux/src/os_atomic.o ../../
        ../porting/npl/linux/src/os_atomic.c
    ../../../porting/npl/linux/src/os_atomic.c:21:9: warning: "__USE_GNU" 
redefined
       21 | #define __USE_GNU
          |         ^~~~~~~~~
    In file included from /usr/include/bits/libc-header-start.h:33,
                     from /usr/include/stdint.h:26,
                     from 
/usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h:9,
                     from ../../../porting/npl/linux/src/os_atomic.c:20:
    /usr/include/features.h:409:10: note: this is the location of the previous 
definition
      409 | # define __USE_GNU      1
          |          ^~~~~~~~~
---
 porting/npl/linux/src/os_atomic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/porting/npl/linux/src/os_atomic.c 
b/porting/npl/linux/src/os_atomic.c
index 743a8470e..531c4a274 100644
--- a/porting/npl/linux/src/os_atomic.c
+++ b/porting/npl/linux/src/os_atomic.c
@@ -17,8 +17,9 @@
  * under the License.
  */
 
-#include <stdint.h>
 #define __USE_GNU
+
+#include <stdint.h>
 #include <pthread.h>
 
 #include "nimble/nimble_npl.h"

Reply via email to