From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9F839387086B; Tue, 25 Jun 2024 20:58:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F839387086B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1719349137; bh=GhyBpJPoOj6Tse7+C7UAuQmKUPAz+HQ9OBo9zW28mEE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jdCZZWfaujn8z1p0DFjy+fTYaEF9Mq6ZHOXzn+sctEr9LDu5eDJKHKI9A9DNXHD/V bEspbumzFW1JmQaxY1MWTiCzFZVaBjSuh9nrVDf0EJzoDRniGPv0nCC/5kz3j0khOX qXUGc+Rkde9n1BhBuaHeRzeFBaH8ibzH4Vrlr8dg= From: "kargls at comcast dot net" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 14.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargls at comcast dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115653 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 t= he 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 =3D module->only_flag; current_intmod =3D INTMOD_NONE; - if (!only_flag) + if (!only_flag && gfc_state_stack->state !=3D COMP_SUBMODULE) gfc_warning_now (OPT_Wuse_without_only, "USE statement at %C has no ONLY qualifier");=