This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't use tail +NNN


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}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]