This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't use tail +NNN
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 04 Oct 2005 16:25:36 -0300
- Subject: Re: [PATCH] Don't use tail +NNN
- References: <42CE38BC.2080507@lu.unisi.ch><Pine.LNX.4.61.0507081224370.14395@digraph.polyomino.org.uk>
On Jul 8, 2005, "Joseph S. Myers" <joseph@codesourcery.com> wrote:
> On Fri, 8 Jul 2005, Paolo Bonzini wrote:
>> The fink 0.8.0 distribution of textutils has the infamous problem of
>> deprecating "tail -NNN" and "tail +NNN", and make compare has started failing
>> for me since I installed Tiger. The attached patch avoids this, using "tail
>> -c +16" instead of "tail +16c".
> The same point as in bug 14251 and all other previous discussions of this
> issue arises: the POSIX options may not be sufficiently portable. How far
> back does "tail -c" go?
That, I don't know.
> Do you have evidence that we no longer support any systems (as build
> systems, not targets) without it? Perhaps it's necessary to start
> with a proposal to cease support for host or build systems without
> certain tools supporting at least POSIX.2-1992 features.
Or use some tool that can portably support what we need, such as dd.
How about `dd if=$$f1 of=tmp-foo1 bs=16 skip=1' ? It'd probably be
slower than tail, since it generally uses unbuffered I/O, so we should
only fall back to it if tail -c +16 does not work.
That said, since we haven't ever got a report about problems with tail
+16c, we might use that if it works, try -c +16 otherwise (or the
other way round, since -c +16 is POSIX standard), and fallback to dd
as a last resort.
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}