From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EF8413858421; Wed, 22 Sep 2021 18:58:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF8413858421 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran Date: Wed, 22 Sep 2021 18:58:55 +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: 4.8.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Sep 2021 18:58:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55534 --- Comment #15 from CVS Commits --- The master branch has been updated by Tobias Burnus : https://gcc.gnu.org/g:83aac698835edcdb3e6d96b856bef1c5f92e5e24 commit r12-3825-g83aac698835edcdb3e6d96b856bef1c5f92e5e24 Author: Tobias Burnus Date: Wed Sep 22 20:58:35 2021 +0200 Fortran: Improve -Wmissing-include-dirs warnings [PR55534] It turned out that enabling the -Wmissing-include-dirs for libcpp did output too many warnings =C3=A2 at least as run with -B and similar options du= ring the GCC build and warning for internal include dirs like finclude, unlikely= of relevance to for a real-world user. This patch now only warns for -I and -J by default but permits to get t= he full warnings including libcpp ones with -Wmissing-include-dirs. It additionally documents this in the manual. With that change, the -Wno-missing-include-dirs could be removed from libgfortran's configure and libgomp's testsuite always cflags. This reverts those bits of the previous commit r12-3722-g417ea5c02cef7f000e66d1af22b066c2c1cda047 Additionally, it turned out that all call to load_file called exit explicitly - except for the main file via gfc_init -> gfc_new_file. The latter also output a file not existing fatal error, such that two errors where printed. Now exit is called in line with the other users of load_file. Finally, when compileing with "nonexisting/file.f90", first a warning t= hat "nonexisting" does not exist as include path was printed before the file not found error was printed. Now the directory in which the physical fi= le is located is added silently, relying on the file-not-found diagnostic = for those. PR fortran/55534 gcc/ChangeLog: * doc/invoke.texi (-Wno-missing-include-dirs.): Document Fortran behavior. gcc/fortran/ChangeLog: * cpp.c (gfc_cpp_register_include_paths, gfc_cpp_post_options): Add new bool verbose_missing_dir_warn argument. * cpp.h (gfc_cpp_post_options): Update prototype. * f95-lang.c (gfc_init): Remove duplicated file-not found diag. * gfortran.h (gfc_check_include_dirs): Takes bool verbose_missing_dir_warn arg. (gfc_new_file): Returns now void. * options.c (gfc_post_options): Update to warn for -I and -J, only, by default but for all when user requested. * scanner.c (gfc_do_check_include_dir): (gfc_do_check_include_dirs, gfc_check_include_dirs): Take bool verbose warn arg and update to avoid printing the same message twice or never. (load_file): Fix indent. (gfc_new_file): Return void and exit when load_file failed as all other load_file users do. libgfortran/ChangeLog: * configure.ac (AM_FCFLAGS): Revert r12-3722 by removing -Wno-missing-include-dirs. * configure: Regenerate. libgomp/ChangeLog: * testsuite/libgomp.fortran/fortran.exp (ALWAYS_CFLAGS): Revert r12-3722 by removing -Wno-missing-include-dirs. * testsuite/libgomp.oacc-fortran/fortran.exp (ALWAYS_CFLAGS): Likewise. gcc/testsuite/ChangeLog: * gfortran.dg/include_14.f90: Add -J testcase and update dg-out= put. * gfortran.dg/include_15.f90: Likewise. * gfortran.dg/include_16.f90: Likewise. * gfortran.dg/include_17.f90: Likewise. * gfortran.dg/include_18.f90: Likewise. * gfortran.dg/include_19.f90: Likewise.=