[PATCH 5/6] libgloss: i386: cygmon-gmon.c: add functions return type

Vincent Mailhol mailhol@kernel.org
Wed Oct 29 06:58:30 GMT 2025


Functions _mcount(), _etext() and _ftext() lack a return type leading
to below GCC errors:

  cygmon-gmon.c:246:1: error: return type defaults to 'int' [-Wimplicit-int]
    246 | _mcount()
        | ^~~~~~~
  cygmon-gmon.c: In function '_mcount':
  cygmon-gmon.c:268:14: error: type defaults to 'int' in declaration of '_etext' [-Wimplicit-int]
    268 |       extern _etext();
        |              ^~~~~~
  cygmon-gmon.c:269:14: error: type defaults to 'int' in declaration of '_ftext' [-Wimplicit-int]
    269 |       extern _ftext();
        |              ^~~~~~

Add the return type to all these functions.

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
---
 libgloss/i386/cygmon-gmon.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libgloss/i386/cygmon-gmon.c b/libgloss/i386/cygmon-gmon.c
index 778dbd76d..3c2f07fed 100644
--- a/libgloss/i386/cygmon-gmon.c
+++ b/libgloss/i386/cygmon-gmon.c
@@ -247,6 +247,7 @@ _mcleanup()
 
 static char already_setup = 0;
 
+void
 _mcount()
 {
   register char			*selfpc;
@@ -269,8 +270,8 @@ _mcount()
 
   if (! already_setup) 
     {
-      extern _etext();
-      extern _ftext();
+      extern char _etext();
+      extern char _ftext();
       already_setup = 1;
       monstartup(_ftext, _etext);
       atexit(_mcleanup);

-- 
2.51.0



More information about the Newlib mailing list