FreeBSD Bugzilla – Attachment 248986 Details for
Bug 277539
Fix bitrot in tools/test
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix compilation of some tools/test programs
test.diff (text/plain), 2.50 KB, created by
John F. Carr
on 2024-03-06 20:41:02 UTC
(
hide
)
Description:
Fix compilation of some tools/test programs
Filename:
MIME Type:
Creator:
John F. Carr
Created:
2024-03-06 20:41:02 UTC
Size:
2.50 KB
patch
obsolete
>commit 3dd76fc9ea14124bdaed75acaad3008cd187aa08 >Author: John F. Carr <jfc@mit.edu> >Date: Mon Mar 4 16:20:50 2024 -0500 > > Update tools/test programs to build with clang17 > >diff --git a/tools/test/bsnmp/Makefile b/tools/test/bsnmp/Makefile >index 47f03ac48a1f..0e18810a3550 100644 >--- a/tools/test/bsnmp/Makefile >+++ b/tools/test/bsnmp/Makefile >@@ -6,6 +6,7 @@ PROG_CXX=ctest > SRCS= main.cc asn1.cc snmp_parse_server.cc > CFLAGS += -I/${CONTRIB}/lib > CXXFLAGS+= -std=c++2a >+CXXWARNFLAGS += -Wno-missing-variable-declarations > LIBADD= bsnmp > > CFLAGS += -DBOGUS_CVE_2019_5610_FIX >diff --git a/tools/test/malloc/main.c b/tools/test/malloc/main.c >index 7c5bf14924de..af1a37f40f26 100644 >--- a/tools/test/malloc/main.c >+++ b/tools/test/malloc/main.c >@@ -3,12 +3,15 @@ > #include <string.h> > #include <unistd.h> > >-u_long NBUCKETS = 2000; >-u_long NOPS = 200000; >-u_long NSIZE = (16*1024); >+static u_long NBUCKETS = 2000; >+static u_long NOPS = 200000; >+static u_long NSIZE = (16*1024); > >+extern char **foo; > char **foo; > >+extern __attribute__((weak)) void *sbrk(intptr_t); >+ > int > main(int argc, char **argv) > { >@@ -17,7 +20,7 @@ main(int argc, char **argv) > if (argc > 1) NOPS = strtoul(argv[1],0,0); > if (argc > 2) NBUCKETS = strtoul(argv[2],0,0); > if (argc > 3) NSIZE = strtoul(argv[3],0,0); >- printf("BRK(0)=%p ", sbrk(0)); >+ if (sbrk) printf("BRK(0)=%p ", sbrk(0)); > foo = malloc(sizeof(*foo) * NBUCKETS); > memset(foo, 0, sizeof(*foo) * NBUCKETS); > for (i = 1; i <= 4096; i *= 2) { >@@ -44,7 +47,7 @@ main(int argc, char **argv) > if (foo[j]) > foo[j][0] = 1; > } >- printf("BRK(1)=%p ", sbrk(0)); >+ if (sbrk) printf("BRK(0)=%p ", sbrk(0)); > for (j = 0; j < NBUCKETS; j++) { > if (foo[j]) { > free(foo[j]); >@@ -52,6 +55,6 @@ main(int argc, char **argv) > } > } > printf("BRK(2)=%p NOPS=%lu NBUCKETS=%lu NSIZE=%lu\n", >- sbrk(0), NOPS, NBUCKETS, NSIZE); >+ sbrk ? sbrk(0) : 0, NOPS, NBUCKETS, NSIZE); > return 0; > } >diff --git a/tools/test/net/connect.c b/tools/test/net/connect.c >index 5c187c164fbd..8f71df805f15 100644 >--- a/tools/test/net/connect.c >+++ b/tools/test/net/connect.c >@@ -41,7 +41,7 @@ > > void usage(void); > >-void usage() >+void usage(void) > { > err(EX_USAGE, "connect [-p port]\n"); > } >diff --git a/tools/test/net/listen.c b/tools/test/net/listen.c >index f14fffe726f8..223005aed4f2 100644 >--- a/tools/test/net/listen.c >+++ b/tools/test/net/listen.c >@@ -41,7 +41,7 @@ > > void usage(void); > >-void usage() >+void usage(void) > { > err(EX_USAGE, "listen [-p port] [-l limit]\n"); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 277539
: 248986