public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargls at comcast dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/115653] USE without ONLY warning when compiling submodules
Date: Tue, 25 Jun 2024 20:58:49 +0000	[thread overview]
Message-ID: <bug-115653-4-27YhxaV3cU@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115653-4@http.gcc.gnu.org/bugzilla/>

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

kargls at comcast dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargls at comcast dot net

--- Comment #1 from kargls at comcast dot net ---
Thanks for the bug report.  Fortunately, it is only warning that clutters the
terminal.

This patch suppresses the warning, but may not catch a 'USE xyz'
within the submodule.

diff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc
index c565b84d61b..5a58a9dbace 100644
--- a/gcc/fortran/module.cc
+++ b/gcc/fortran/module.cc
@@ -7285,7 +7285,7 @@ gfc_use_module (gfc_use_list *module)
   only_flag = module->only_flag;
   current_intmod = INTMOD_NONE;

-  if (!only_flag)
+  if (!only_flag && gfc_state_stack->state != COMP_SUBMODULE)
     gfc_warning_now (OPT_Wuse_without_only,
                     "USE statement at %C has no ONLY qualifier");

      reply	other threads:[~2024-06-25 20:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 20:48 [Bug fortran/115653] New: " gmt3141 at gmail dot com
2024-06-25 20:58 ` kargls at comcast dot net [this message]

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-115653-4-27YhxaV3cU@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).