This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [libgfortran, patch] Remove unused headers
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: FX <fxcoudert at gmail dot com>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 21 Dec 2016 12:14:27 +0200
- Subject: Re: [libgfortran, patch] Remove unused headers
- Authentication-results: sourceware.org; auth=none
- References: <487D7441-810F-4DBC-92FC-4BA49B65F5E9@gmail.com>
On Wed, Dec 21, 2016 at 12:05 PM, FX <fxcoudert@gmail.com> wrote:
> The attached patch removes some unused headers from libgfortran sources. It removes 320 assert.h, 31 stdlib.h, 12 string.h, 4 errno.h, and the occasional math.h, unistd.h, and limits.h.
>
> I have audited all files manually, checking for function calls. Patch was bootstrapped and regtested on x86_64-apple-darwin16.3.0.
> OK to commit?
Ok. Watch out for regressions on other targets though. I have more
than once caused regressions by using some function that happened to
be included in the existing headers on glibc, but needed some other
header on other targets.
> PS: after that patch, the most often used header (not included in libgfortran.h) is stdlib.h, used in 351 out of 436 library source files. Maybe that warrants including it in libgfortran.h? (next are string.h with 129 includes and limits.h with 113)
Yes, sounds reasonable to include stdlib.h, yes.
I have occasionally thought about splitting libgfortran.h, it's
annoying when one does some minor change affecting maybe 1 or 2 .o
files, but the entire libgfortran has to be rebuilt.. But beyond being
annoyed, I haven't done anything further about it.
--
Janne Blomqvist