Re: sid cgen cpus broken by absence of pic libiberty

Jim Blandy <[email protected]>
Newsgroups gmane.comp.emulators.sid.devel,gmane.comp.tools.cgen.devel
Message-ID <[email protected]>
"Frank Ch. Eigler" <[email protected]> writes:
> > >  [...]
> > > How about adding "setlocale (LC_CTYPE, "C");" around a batch of
> > > cgen parsing?
> > 
> > And then arranging to carefully set it back before we leave, either
> > successfully or with an error?  From any of the callback functions we
> > might be using to read memory, like those in GDB, that use longjmp?
> 
> OK (though it sounds strange that we would do keyword
> parsing from within such contexts).

Actually, I was being sarcastic.  The whole "set this global variable,
then do something, and then set it back" maneuver doesn't sit well
with me; it just feels like asking for trouble.  But I may well be
exaggerating the issue.

On GNU, if the ambient locale is already "C", then setlocale is cheap.
But otherwise, setlocale goes and parses the name, looks up components
of it in tables, and so on.  Do you really want to do that for every
keyword of every instruction the compiler generates on CGEN-generated
architectures?

It seems better to me to simply write out the test, packaged up as a
macro as Doug suggested.
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.