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

Vincent Mailhol <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <20251029-fix-libgloss-i386-compile-issues-v1-5-26edcb02f69c@kernel.org>
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 <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.