[PATCH 6/6] libgloss: i386: cygmon-gmon.c: fix _mcount() return type

Vincent Mailhol <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <20251029-fix-libgloss-i386-compile-issues-v1-6-26edcb02f69c@kernel.org>
_mcount() is declared as returning an int, but in reality, it always
returns void as shown by those GCC errors:

  cygmon-gmon.c: In function 'monstartup':
  cygmon-gmon.c:142:7: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
    142 |       return;
        |       ^~~~~~
  cygmon-gmon.c:118:1: note: declared here
    118 | monstartup(lowpc, highpc)
        | ^~~~~~~~~~
  cygmon-gmon.c:150:7: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
    150 |       return;
        |       ^~~~~~
  cygmon-gmon.c:118:1: note: declared here
    118 | monstartup(lowpc, highpc)
        | ^~~~~~~~~~
  cygmon-gmon.c:171:7: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
    171 |       return;
        |       ^~~~~~
  cygmon-gmon.c:118:1: note: declared here
    118 | monstartup(lowpc, highpc)
        | ^~~~~~~~~~
  cygmon-gmon.c:182:5: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
    182 |     return;
        |     ^~~~~~
  cygmon-gmon.c:118:1: note: declared here
    118 | monstartup(lowpc, highpc)
        | ^~~~~~~~~~

Change monstartup()'s return type from int to void.

Signed-off-by: Vincent Mailhol <[email protected]>
---
 libgloss/i386/cygmon-gmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgloss/i386/cygmon-gmon.c b/libgloss/i386/cygmon-gmon.c
index 3c2f07fed..b6e2467b0 100644
--- a/libgloss/i386/cygmon-gmon.c
+++ b/libgloss/i386/cygmon-gmon.c
@@ -118,7 +118,7 @@ moncontrol(int mode)
     }
 }
 
-int
+void
 monstartup(lowpc, highpc)
      char	*lowpc;
      char	*highpc;

-- 
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.