public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-1472] [Ada] Add RM reference to check for functions without a return statement
Date: Tue,  5 Jul 2022 08:29:12 +0000 (GMT)	[thread overview]
Message-ID: <20220705082912.6886338582A2@sourceware.org> (raw)

https://gcc.gnu.org/g:70bb3298c2b4eaec19490ada47dbc3d7307002af

commit r13-1472-g70bb3298c2b4eaec19490ada47dbc3d7307002af
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Thu Jun 2 15:16:44 2022 +0200

    [Ada] Add RM reference to check for functions without a return statement
    
    Add comment to explain why we have an error and not just a warning.
    
    gcc/ada/
    
            * sem_ch6.adb (Check_Missing_Return): Add reference to an RM rule.

Diff:
---
 gcc/ada/sem_ch6.adb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 5a4ba7a9290..05db793a155 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -3568,6 +3568,10 @@ package body Sem_Ch6 is
                Id := Body_Id;
             end if;
 
+            --  A function body shall contain at least one return statement
+            --  that applies to the function body, unless the function contains
+            --  code_statements; RM 6.5(5).
+
             if Return_Present (Id) then
                Check_Returns (HSS, 'F', Missing_Ret);


                 reply	other threads:[~2022-07-05  8:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220705082912.6886338582A2@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@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).