Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: R14->R15



On 5/22/02 10:20 PM, Adam Wildavsky wrote:
>> That's returning a pointer to temporary stack data. It's inherently unsafe.
>
> True, but that's what the qBackwardCompatible operator const char *
> has been doing for years. Our code already relies on it, and I've
> encountered no problems to date. It does require that inlining be
> turned on, per the comment in the header.

Okay, but that doesn't make it truly safe. At best, it just reduces the
likelihood of the string being corrupted. Before we removed the operator
const char * there was a definite case of a string being overwritten even
with inlining.

>> How about:
>>
>> #if MA_Version >= 0x0F00
>> #define MyString CString_AC
>> #else
>> #define MyString CStr255_AC
>> #endif
>
> And then try a global search and replace of CStr255 and CStr255_AC
> with MyString within my sources? It might work, and certainly should
> work through MacApp R14.

My recommendation would be to use it as little as possible. It's a flag that
there's a string compatibility issue. Let the compiler make you do it.

> Any suggestions as to a more informative name than MyString? Perhaps
> CMacAppString would do the trick.

SchizoString?

Regards,

Tom

--
Tom Becker "Within C++, there is a much smaller and
Object-Oriented Propeller Head cleaner language struggling to get out."
<email@hidden> -- Bjarne Stroustrup
_______________________________________________
macapp-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macapp-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: R14->R15 (From: Adam Wildavsky <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.