dtrace tests: fix prototypes for gcc build

- quiet -Wstrict-prototypes
 - provide prototypes for weak aliases

Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D28036
This commit is contained in:
Ryan Libby 2021-01-10 21:53:15 -08:00
parent af1878dac7
commit c14e17a49c
4 changed files with 9 additions and 6 deletions

View File

@ -41,7 +41,7 @@ f2(f func, int i)
} }
int int
main() main(void)
{ {
f2(f1, 3); f2(f1, 3);

View File

@ -66,7 +66,7 @@ fN2(f func, char *a, int i __unused)
} }
int int
main() main(void)
{ {
/* /*
* Avoid length of 1, 2, 4, or 8 bytes so DTrace will treat the data as * Avoid length of 1, 2, 4, or 8 bytes so DTrace will treat the data as

View File

@ -33,8 +33,7 @@
* leading underscores. * leading underscores.
*/ */
#pragma weak _go = go extern int _go(int);
int go(int); int go(int);
int int
@ -57,3 +56,5 @@ main(void)
for (;;) for (;;)
getpid(); getpid();
} }
#pragma weak _go = go

View File

@ -33,14 +33,14 @@
* leading underscores. * leading underscores.
*/ */
extern int _go(int);
static int __unused static int __unused
go(int a) go(int a)
{ {
return (a + 1); return (a + 1);
} }
#pragma weak _go = go
static void static void
handle(int sig __unused) handle(int sig __unused)
{ {
@ -55,3 +55,5 @@ main(void)
for (;;) for (;;)
getpid(); getpid();
} }
#pragma weak _go = go