Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli via buildroot <buildroot@buildroot.org>
To: katz.agentpp.com@magenta.de, support@agentpp.com
Cc: "buildroot@buildroot.org" <buildroot@buildroot.org>
Subject: [Buildroot] Agent++ 4.6.0: const/nonconst type mismatch build failure
Date: Mon, 26 Jun 2023 18:12:18 +0200	[thread overview]
Message-ID: <20230626181218.7676f022@booty> (raw)

[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]

Hello AGENT++ developers,

the automatic testing infrastructure of the Buildroot embedded Linux
build system is reporting a build failure in AGENT++:

snmp_pp_ext.cpp:1217:26: error: binding reference of type 'Snmp_pp::Pdu&' to 'const Snmp_pp::Pdu' discards qualifiers
 1217 |   status = snmpmsg.load( pdu, community, version);
      |                          ^~~

This is due to a mismatch between the SNMP++ APIs and AGENT++.

This failure is happening since several months and was happening also
with version 4.5.4.

Here you can find info, including logs, about some of the failed builds:

  http://autobuild.buildroot.net/results/e8abd6bdc62a028955915706b03d72239786c703/
  http://autobuild.buildroot.net/results/24441fb679fbf5f913c9b6431c98aec596ead587/
  http://autobuild.buildroot.net/results/d7347b8b3953596b66da6ca6d85f084fb427934c/

I have prepared a patch against AGENT++ 4.6.0 that fixes the problem
according to my tests, please find it attached.

It would be great to have this fixed in the next mainline release of
AGENT++!

Best regards,
Luca Ceresoli

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: 0001-Snmpx-fix-const-nonconst-type-mismatch.patch --]
[-- Type: text/x-patch, Size: 1807 bytes --]

From 7e541e6dba8d4976bbb490838a09b569f38b047d Mon Sep 17 00:00:00 2001
From: Luca Ceresoli <luca.ceresoli@bootlin.com>
Date: Mon, 26 Jun 2023 17:45:00 +0200
Subject: [PATCH] Snmpx: fix const/nonconst type mismatch

Fixes build failure:

  snmp_pp_ext.cpp:1176:28: error: binding reference of type 'Snmp_pp::Pdu&' to 'const Snmp_pp::Pdu' discards qualifiers
   1176 |     status = snmpmsg.load( pdu, community, version);
        |                            ^~~

Fixes:
  http://autobuild.buildroot.net/results/e8abd6bdc62a028955915706b03d72239786c703/
  http://autobuild.buildroot.net/results/24441fb679fbf5f913c9b6431c98aec596ead587/

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
 include/agent_pp/snmp_pp_ext.h | 2 +-
 src/snmp_pp_ext.cpp            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/agent_pp/snmp_pp_ext.h b/include/agent_pp/snmp_pp_ext.h
index 7c5a6783ee70..d8a46060db98 100644
--- a/include/agent_pp/snmp_pp_ext.h
+++ b/include/agent_pp/snmp_pp_ext.h
@@ -807,7 +807,7 @@ public:
 	 *   SNMP_CLASS_SUCCESS on success and SNMP_CLASS_ERROR,
 	 *   SNMP_CLASS_TL_FAILED on failure.
 	 */
-        int send (Pdux const &, NS_SNMP UdpAddress const &, NS_SNMP snmp_version, NS_SNMP OctetStr const &);
+        int send (Pdux &, NS_SNMP UdpAddress const &, NS_SNMP snmp_version, NS_SNMP OctetStr const &);
 #endif
 
 	/**
diff --git a/src/snmp_pp_ext.cpp b/src/snmp_pp_ext.cpp
index 54a29ec8ea28..b61cbf056246 100644
--- a/src/snmp_pp_ext.cpp
+++ b/src/snmp_pp_ext.cpp
@@ -1203,7 +1203,7 @@ int Snmpx::send (Pdux &pdu, SnmpTarget* target)
 
 #else  // _SNMPv3 is not defined
 
-int Snmpx::send (Pdux  const &pdu,
+int Snmpx::send (Pdux  &pdu,
 		 UdpAddress  const &udp_address,
 		 snmp_version version,
 		 OctetStr  const &community)
-- 
2.34.1


[-- Attachment #3: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

                 reply	other threads:[~2023-06-26 16:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230626181218.7676f022@booty \
    --to=buildroot@buildroot.org \
    --cc=katz.agentpp.com@magenta.de \
    --cc=luca.ceresoli@bootlin.com \
    --cc=support@agentpp.com \
    /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