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]

Re: PATCH: Pascal Strings -- TAKE FOUR


On Tue, 3 Jul 2001, Ziemowit Laski wrote:

> > Please advise on how I should encode that information -- I'm tempted to
> > say
> >
> >    ((unsigned char)-1)
> >
> > but perhaps there's some macro somewhere in the bowels of gcc that's
> > more suitable?

What's relevant is the *target* character size - so try TYPE_MAX_VALUE
(unsigned_char_type_node).  This will return an INTEGER_CST.  GCC doesn't
properly handle string constants when target and host characters are
different sizes, but some day this should be fixed.

Make sure, of course, that allowing longer strings on such platforms is
correct.  What does the ISO Pascal standard say about string lengths and
byte sizes?

> Oh, yes, this leads to one more thing -- how should I construct the test
> cases to test for an excessively long Pascal string?  Currently, I just
> hard-code a 256-character string, but that would be perfectly fine with
> 16-bit chars (and so the test case would fail).  Is there some sort

The simple solution is to XFAIL that test if the target is 1750a, dsp16xx
or c4x (of which c4x is probably the only one of those ports that is
live).

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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