This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Protect generated .h files from multiple inclusion, include tm.h in hooks.h, and FIX BOOTSTRAP
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Nathanael Nerode <neroden at twcny dot rr dot com>, gcc-patches at gcc dot gnu dot org
- Date: 19 Jun 2003 01:30:05 -0300
- Subject: Re: [patch] Protect generated .h files from multiple inclusion, include tm.h in hooks.h, and FIX BOOTSTRAP
- Organization: GCC Team, Red Hat
- References: <20030619011527.GA8744@doctormoo><87d6halttl.fsf@egil.codesourcery.com>
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