Re: sid cgen cpus broken by absence of pic libiberty

Jim Blandy <[email protected]>
Newsgroups gmane.comp.tools.cgen.devel,gmane.comp.emulators.sid.devel
Message-ID <[email protected]>
Doug Evans <[email protected]> writes:
> Jim Blandy writes:
>  > *************** cgen_parse_keyword (CGEN_CPU_DESC cd ATT
>  > *** 216,222 ****
>  >     /* Allow letters, digits, and any special characters.  */
>  >     while (((p - start) < (int) sizeof (buf))
>  >   	 && *p
>  > ! 	 && (ISALNUM (*p)
>  >   	     || *p == '_'
>  >   	     || strchr (keyword_table->nonalpha_chars, *p)))
>  >       ++p;
>  > --- 216,224 ----
>  >     /* Allow letters, digits, and any special characters.  */
>  >     while (((p - start) < (int) sizeof (buf))
>  >   	 && *p
>  > ! 	 && (('a' <= *p && *p <= 'z')
>  > !              || ('A' <= *p && *p <= 'Z')
>  > !              || ('0' <= *p && *p <= '9')
>  >   	     || *p == '_'
>  >   	     || strchr (keyword_table->nonalpha_chars, *p)))
>  >       ++p;
>  > 
>  > Does that sound reasonable (well, reasonable with a clothespin on the
>  > nose) to folks?
> 
> Well, I'd still tuck the code away in macro or whatever.

Okay.

> Or, use just plain ctype.  This is just one example so
> who knows what libiberty actually brings to the party
> in all the affected cases though.

The problem with plain ctype is that it's sensitive to locale.  You
don't want the set of strings accepted as keywords to change based on
the user's environment variables.  :(

> Seems pretty sad though, eh?
> 
> Maybe the thing to do is create one's own mini-libiberty
> that one controls and so isn't sacked with the politics or
> whatever of binutils.  Keeping the naming close to libiberty
> would allow an easier transition back to libiberty if such
> a day arrives.

Depending on how much stuff the cgen files actually use, that could be
a good idea.

Thanks for the comments!  I'll have a patch eventually.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.