Netdev Archive mirror
 help / color / mirror / Atom feed
From: Brahmajit Das <brahmajit.xyz@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH 1/1] Fix implicit declaration of function 'htobe64' in gcc 14 on musl systems
Date: Tue, 14 May 2024 06:35:37 +0000	[thread overview]
Message-ID: <20240514063811.383371-1-brahmajit.xyz@gmail.com> (raw)

On musl systems with GCC 14 and above, the htobe64 function cannot be
found by default. From the man page[0], the function is from endian.h
header file. If the file is not included in, then we get the following
error message. The issue however cannot be reproduced on glibc systems.

In file included from ../include/libgenl.h:5,
                 from libgenl.c:12:
../include/libnetlink.h: In function 'rta_getattr_be64':
../include/libnetlink.h:281:16: error: implicit declaration of function 'htobe64' [-Wimplicit-function-declaration]
  281 |         return htobe64(rta_getattr_u64(rta));
      |                ^~~~~~~
make[1]: *** [../config.include:24: libgenl.o] Error 1

[0]: https://linux.die.net/man/3/htobe64

Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
---
 include/libnetlink.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/libnetlink.h b/include/libnetlink.h
index 30f0c2d2..77e81815 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -12,6 +12,7 @@
 #include <linux/neighbour.h>
 #include <linux/netconf.h>
 #include <arpa/inet.h>
+#include <endian.h>
 
 struct rtnl_handle {
 	int			fd;
-- 
2.45.0


             reply	other threads:[~2024-05-14  6:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14  6:35 Brahmajit Das [this message]
2024-05-14 15:43 ` [PATCH 1/1] Fix implicit declaration of function 'htobe64' in gcc 14 on musl systems Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240514063811.383371-1-brahmajit.xyz@gmail.com \
    --to=brahmajit.xyz@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).