This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Avoid trailing whitespace in sysdeps/gnu/errlist.c
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 6 Jun 2013 12:50:25 +0000
- Subject: Re: Avoid trailing whitespace in sysdeps/gnu/errlist.c
- References: <Pine dot LNX dot 4 dot 64 dot 1306061218550 dot 28623 at digraph dot polyomino dot org dot uk> <20130606142921 dot GA5936 at domone dot kolej dot mff dot cuni dot cz> <Pine dot LNX dot 4 dot 64 dot 1306061236390 dot 28623 at digraph dot polyomino dot org dot uk> <20130606144247 dot GA6082 at domone dot kolej dot mff dot cuni dot cz>
On Thu, 6 Jun 2013, Ondrej Bilka wrote:
> On Thu, Jun 06, 2013 at 12:38:50PM +0000, Joseph S. Myers wrote:
> > On Thu, 6 Jun 2013, Ondrej Bilka wrote:
> >
> > > On Thu, Jun 06, 2013 at 12:19:23PM +0000, Joseph S. Myers wrote:
> > > > This patch avoids trailing whitespace in the generated file
> > > > sysdeps/gnu/errlist.c by adjusting the generator errlist.awk not to
> > > > generate it. Tested x86_64.
> > > >
> > > You should use single tool that does job perfectly than reimplement it.
> > > Please add pass to delete trailing whitespace.
> >
> > I disagree. I believe that when we check in generated files and control
> > the generator program, we should make the generator program generate
> > output in the form we want to check in, rather than postprocessing the
> > output with a separate program. I think postprocessing should only be a
> > last resort for cases where we do not control the generator and do not
> > want to require a fixed version of it (or a fixed release does not exist).
> >
> If you want to maintain it then it is your decision. Duplicating
> functionality in five places while it would suffice in one is generaly
> bad so I pointed about this mistake.
Each generated file has its own makefile rules; if five files are
affected, you can't avoid five places being involved. And for each file,
I think it's better to have the functionality "generate the contents that
we want to check in for this file" in one place, rather than split between
the makefile and a separate script generating output similar to but not
the same as what is wanted.
A postprocessor to remove whitespace is covering up a bug elsewhere that
generated the unwanted whitespace in the first place. When the bug is in
part of glibc, we should just fix it.
--
Joseph S. Myers
joseph@codesourcery.com