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] Protect generated .h files from multiple inclusion, include tm.h in hooks.h, and FIX BOOTSTRAP


On Jun 18, 2003, Zack Weinberg <zack@codesourcery.com> wrote:

>> (Could get into problems if the use of 'sed' turns out to be unportable
>> in some stupid way, but I doubt that.)

> I think y/// is portable, but just to be safe, suggest you use tr instead:

> tr_from='abcdefghijklmnopqrstuvwxyz./'
> tr_to='ABCDEFGHIJKLMNOPQRSTUVWXYZ__'
> header_guard=GCC_`echo "$output" | tr "$tr_from" "$tr_to"`

> Note also the inclusion of / in the transliteration set.

I'd add `-' too, just in case.  Maybe use tr to turn letters into
upper-case (do we really need to do it?), then sed to turn any
non-capital-letter into an underscore?

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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