From nobody Fri May 17 10:59:00 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgkVF06VZz5Kyfr for ; Fri, 17 May 2024 10:59:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgkVD0dLmz57MF for ; Fri, 17 May 2024 10:59:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715943540; a=rsa-sha256; cv=none; b=NZMTpKc2uI2b2fX3ro+JYvi6CU716Md+6qxa9Fr5E9sLj0kUjpmlzt8gBlGnFTiFeCrPGy OvNgzs8thZVedatFiQn4SbusHF3/NOR7ELGROJtGofB12IDXHqSGAuvjkS88TRyWOt3Og9 T9zt7/kNRbnzfXG5Umw169A6laCkevuDIpvY9sDwGwV5J7y1y8OEWDmJMqlx6XWfnJVrix 7l0fpm1uCDzYy9q7tlorP0dCNNRziTYWtQVytdBVfgL5YPohJBODmbOn02C1FFBXzJ67Lg jrnj+ZcCdW72JQs51ZJr3Uh52Cjt3mCPdOnR2lb1pFxSS21Q1jfGy5waz0xFiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715943540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c6MpQpeo/d0DfTwamwiPwkpQgA8Op8wfWJfq/5b896Q=; b=X6KezxEMiSAVYeIt4ZVyTCzJWP4lbQX2sly+1eMzwv5d1SkMuDO5AYTsSE8hUf/8B+BLhu yTVXs6QV3Bsp1jcZ6BOtv8DJvIBsAWOoekvfkyWFwKPpliCW67LfjryHJDf1DO8Q4R6tEe 0/091GFIyqhV9Lsptns+EcsCae7lsrb3YyW1x21V6kjD+F/U0TpbtaEhzC5NZJrv6kWLQv LlLzvnTVKT11Rwt6CbTE10RljxqDKZCOaKUoue1ojiUCKG3Edk2Vh+ADqURSrVxDzr/3t/ flBm0iDqKE5I/g22mLgOESq74ezEBRROEb9/CEWA4Vae75ZqvboppwylhiZ/oA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgkVD076Hzg9r for ; Fri, 17 May 2024 10:59:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 44HAwx24095771 for ; Fri, 17 May 2024 10:58:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 44HAwxhw095770 for bugs@FreeBSD.org; Fri, 17 May 2024 10:58:59 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 279054] Compile failure when #include in C++ code Date: Fri, 17 May 2024 10:59:00 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 14.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: cnbatch@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D279054 Bug ID: 279054 Summary: Compile failure when #include in C++ code Product: Base System Version: 14.0-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: cnbatch@gmail.com Both FreeBSD 14 and 15 generated the same errors.=20 C++ Codes: ``` #include int main() { snl_state st{}; return 0; } ``` Errors: In file included from main.cpp:1: /usr/include/netlink/netlink_snl.h:83:24: error: cannot initialize a variab= le of type 'struct linear_buffer *' with an rvalue of type 'void *' 83 | struct linear_buffer *lb =3D calloc(1, size); | ^ ~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:107:9: error: cannot initialize return object of type 'char *' with an lvalue of type 'void *' 107 | return (data); | ^~~~~~ /usr/include/netlink/netlink_snl.h:278:12: error: assigning to 'char *' from incompatible type 'void *' 278 | ss->buf =3D malloc(ss->bufsize); | ^~~~~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:498:2: error: no matching function for c= all to 'snl_parse_fields' 498 | snl_parse_fields(ss, hdr, parser->in_hdr_size, parser->fp, parser->fp_size, target); | ^~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:479:1: note: candidate function not viab= le: cannot convert argument of incomplete type 'void *' to 'struct nlmsghdr *' = for 2nd argument 479 | snl_parse_fields(struct snl_state *ss, struct nlmsghdr *hdr, int hd= rlen __unused, | ^ ~~~~~~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:619:8: error: cannot initialize a variab= le of type 'char *' with an rvalue of type 'void *' 619 | char *buf =3D snl_allocz(ss, maxlen + 1); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:636:3: error: no matching function for c= all to 'strlcpy' 636 | strlcpy(target, tmp, (size_t)arg); | ^~~~~~~ /usr/include/string.h:98:9: note: candidate function not viable: cannot con= vert argument of incomplete type 'void *' to 'char *__restrict' for 1st argument 98 | size_t strlcpy(char * __restrict, const char * __restrict, size_t= ); | ^ ~~~~~~ In file included from main.cpp:1: /usr/include/netlink/netlink_snl.h:649:9: error: cannot initialize a variab= le of type 'char *' with an rvalue of type 'void *' 649 | char *buf =3D snl_allocz(ss, maxlen); | ^ ~~~~~~~~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:678:21: error: cannot initialize a varia= ble of type 'struct snl_parray *' with an lvalue of type 'void *' 678 | struct snl_parray *array =3D target; | ^ ~~~~~~ /usr/include/netlink/netlink_snl.h:685:17: error: assigning to 'void **' fr= om incompatible type 'void *' 685 | array->items =3D snl_allocz(ss, size * sizeof(void *)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:701:2: error: assigning to 'struct nlatt= r *' from incompatible type 'void *' 701 | NLA_FOREACH(nla, NLA_DATA(container_nla), NLA_DATA_LEN(container_nla)) { |=20=20=20=20=20=20=20=20 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:66:22: note: expanded from macro 'NLA_FOREACH' 66 | for (_attr =3D (_start); \ | ^~~~~~~~ /usr/include/netlink/netlink_snl.h:715:11: error: cannot initialize a varia= ble of type 'void **' with an rvalue of type 'void *' 715 | void **new_array =3D snl_allocz(ss, new_size *sizeof(void *)); | ^=20=20=20=20=20=20=20=20=20=20 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:828:26: error: cannot initialize a varia= ble of type 'struct snl_attr_bitset *' with an lvalue of type 'void *' 828 | struct snl_attr_bitset *target =3D _target; | ^ ~~~~~~~ /usr/include/netlink/netlink_snl.h:864:26: error: cannot initialize a varia= ble of type 'struct snl_attr_bitset *' with an lvalue of type 'void *' 864 | struct snl_attr_bitset *target =3D _target; | ^ ~~~~~~~ /usr/include/netlink/netlink_snl.h:984:11: error: no matching function for = call to 'snl_parse_attrs_raw' 984 | return (snl_parse_attrs_raw(ss, data, len, ps->np, ps->np_size, attrs)); | ^~~~~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:448:1: note: candidate function not viab= le: cannot convert argument of incomplete type 'void *' to 'struct nlattr *' for 2nd argument 448 | snl_parse_attrs_raw(struct snl_state *ss, struct nlattr *nla_head, = int len, | ^ ~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:1026:13: error: assigning to 'char *' fr= om incompatible type 'void *' 1026 | nw->base =3D snl_allocz(ss, nw->size); | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/netlink/netlink_snl.h:1064:14: error: assigning to 'char *' fr= om incompatible type 'void *' 1064 | nw->base =3D new_base; | ^~~~~~~~ 16 errors generated. --=20 You are receiving this mail because: You are the assignee for the bug.=