[PATCH 2/6] libgloss: i386: cygmon-gmon.c: add profil() prototype
Vincent Mailhol <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <20251029-fix-libgloss-i386-compile-issues-v1-2-26edcb02f69c@kernel.org> |
Add the prototype of profil() to resolve below GCC error:
cygmon-gmon.c: In function 'moncontrol':
cygmon-gmon.c:349:7: error: implicit declaration of function 'profil' [-Wimplicit-function-declaration]
349 | profil((unsigned short *)(sbuf + sizeof(struct phdr)),
| ^~~~~~
Note that unistd.h in which profil() is normally present is not
sufficient here because newlib's unistd.h does not provide it.
Signed-off-by: Vincent Mailhol <[email protected]>
---
libgloss/i386/cygmon-gmon.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libgloss/i386/cygmon-gmon.c b/libgloss/i386/cygmon-gmon.c
index ac3af30a6..7d0697852 100644
--- a/libgloss/i386/cygmon-gmon.c
+++ b/libgloss/i386/cygmon-gmon.c
@@ -68,6 +68,9 @@ static char sccsid[] = "@(#)gmon.c 5.3 (Berkeley) 5/22/91";
#include "cygmon-gmon.h"
+int profil(unsigned short *tampon, size_t taille_tampon,
+ size_t offset, unsigned int echelle);
+
/*
* froms is actually a bunch of unsigned shorts indexing tos
*/
--
2.51.0