public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug modula2/108551] gcc/m2/gm2-libs-pim/Termbase.mod:128:1: error: control reaches end of non-void function [-Werror=return-type]
Date: Thu, 26 Jan 2023 12:54:37 +0000	[thread overview]
Message-ID: <bug-108551-4-FN4jcZwcuv@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108551-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108551

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #3)
> I might reduced that:
> 
> $ cat Termbase.mod
> IMPLEMENTATION MODULE Termbase ;
> TYPE
>    ReadMethods = POINTER TO RECORD
>                                s   : StatusProcedure ;
>                             END ;
>    WriteMethod = POINTER TO RECORD
>                             END ;
> VAR
>    rStack: ReadMethods ;
>    wStack: WriteMethod ;
> PROCEDURE AssignRead (rp: ReadProcedure; sp: StatusProcedure;
>                       VAR Done: BOOLEAN) ;
> BEGIN
>    IF rStack=NIL
>    THEN
>    END
> END AssignRead ;
> (*
> *)
> PROCEDURE UnAssignRead (VAR Done: BOOLEAN) ;
> END UnAssignRead ;
> PROCEDURE Read (VAR ch: CHAR) ;
> END Read ;
> PROCEDURE KeyPressed () : BOOLEAN ;
> BEGIN
>    IF rStack=NIL
>    THEN
>       RETURN( rStack^.s() )
>     ELSE
>       RETURN( rStack^.s() )
>    END
> END KeyPressed ;
> PROCEDURE AssignWrite (wp: WriteProcedure; VAR Done: BOOLEAN) ;
> BEGIN
>    IF wStack=NIL
>    THEN   
>    END
> END AssignWrite ;
> PROCEDURE UnAssignWrite (VAR Done: BOOLEAN) ;
> END UnAssignWrite ;
> PROCEDURE Write (VAR ch: CHAR) ;
> END Write ;
> END Termbase.
> 
> $ /dev/shm/objdir/./gcc/gm2 -B/dev/shm/objdir/./gcc/ Termbase.mod
> -Werror=return-type -I/home/marxin/Programming/gcc/gcc/m2/gm2-libs-pim
> -I/home/marxin/Programming/gcc/gcc/m2/gm2-libs
> Termbase.mod: In function ‘main’:

^^^

that's again for 'main', like my attempt at a reduced testcase.  I think
the proper fix is to give up on fixing this diagnostic and instead ignore
-Wreturn-type as intended.

  parent reply	other threads:[~2023-01-26 12:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26  7:33 [Bug modula2/108551] New: " rguenth at gcc dot gnu.org
2023-01-26  7:35 ` [Bug modula2/108551] " rguenth at gcc dot gnu.org
2023-01-26  8:33 ` rguenth at gcc dot gnu.org
2023-01-26  9:27 ` marxin at gcc dot gnu.org
2023-01-26 10:28 ` marxin at gcc dot gnu.org
2023-01-26 12:54 ` rguenth at gcc dot gnu.org [this message]
2023-01-26 16:24 ` gaius at gcc dot gnu.org
2023-01-26 16:41 ` gaius at gcc dot gnu.org
2023-01-26 18:45 ` gaius at gcc dot gnu.org
2023-01-26 21:44 ` gaius at gcc dot gnu.org
2023-01-27  7:43 ` rguenth at gcc dot gnu.org
2023-01-27  9:38 ` marxin at gcc dot gnu.org
2023-02-01 17:26 ` cvs-commit at gcc dot gnu.org
2023-02-03  9:01 ` gaius at gcc dot gnu.org
2023-02-03  9:17 ` marxin at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108551-4-FN4jcZwcuv@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).