PATCH: Support for Pascal strings

Ziemowit Laski zlaski@apple.com
Fri Jun 15 20:20:00 GMT 2001


On Friday, June 15, 2001, at 06:37 , Joseph S. Myers wrote:

> Every extension poses a continuing maintenance burden on GCC maintainers
> and so needs compelling justification - for the extension and its 
> design,
> considered afresh.  In this case you need to justify why the burden 
> should
> fall on GCC maintainers rather than on Apple.  The extension seemed at
> first sight to be such a bad idea that the patch was not worth 
> attempting
> to technically review, the sole redeeming feature being the presence of
> testcases.

I agree that it imposes an incremental burden on the community (as does
every other feature addition), and so I'll work to make the delta as
small as possible.  However, unless a major retrofit in the handling
of string literals by the front-end is in the works, this burden should
be confined to simply moving these changes forward (which can be done
without even being aware of them).

> In any case, it is necessary to show - and document - a clear
> understanding of how the extension interacts with everything else in the
> relevant language standards.  If you haven't read at least one of the
> relevant standards, I think proposing extensions is ill-advised.  Points
> to consider might be: how does this interact with multibyte characters?
> What array types, if any, can be initialised by one of these string
> literals?  What is the type, both with and without -Wwrite-strings, and 
> in
> C++, and what conversions are such strings subject to in C++?  May these
> strings be merged with other strings?  Are they NUL-terminated?  Is it a
> constraint violation for the string to be too long?  Do you handle 
> target
> bytes wider than 8 bits?  In principle you should be able to propose
> precise textual changes to the relevant language standards, with
> rationale.

I definitely agree with you in that the interactions of Pascal string
literals with other (existing) language constructs should be analyzed and
described.  I would be more than happy to include such a write-up in the
next version of my patch -- perhaps you can suggest which file(s) this 
would
belong in?

What I agree much less on (although admittedly this is a bit out of my
league) is the need to somehow feed this Pascal-string idea back
into the C and C++ standards.  What is wrong with having just a humble
extension (and one that is disabled by default)?

--Zem
--------------------------------------------------------------
Ziemowit Laski                   Apple Computer, Inc.
zlaski@apple.com                 2 Infinite Loop, MS 302-4SN
+1.408.974.6229  Fax .1344       Cupertino, CA  95014-2085



More information about the Gcc-patches mailing list