Re: Are _T() and TEXT() macros equivalent?



Oh, please don't misunderstand. Should char be 2 bytes, existing code like
this WOULD have to be rewritten, perhaps to
....
My point is for new programs (and even existing programs,with sufficient
compiler warnings similar to the spiel that VC2005 puts out concerning
strcpy_s, for example), defining char to be 2 bytes makes it easy to:

Now I fail to see the advantage.

Your option:
- The old programs need changes
- For new ones is easy to use char as Unicode character
- The result is not standard
- The result is not cross-platform
Current option:
- The old programs need changes
- For new ones is easy to use wchar_t as Unicode character
- The result is standard
- The result is cross-platform

All this to avoid macros?

Again, existing files would have to be converted, or else code to
read/write them have to specifically use one byte chars.
You cannot convert legacy files. Legacy files don't mean "files I have saved
a while ago"
It also means any other files out there that are not Unicode UTF-16LE,
what is called import/export. Think HTML, XML, text.


It would require rework. But that didn't stop the new things like
strcpy_s which breaks existing code as well.
It does not break existing code. It is just a warning.
And strcpy_s is a non-standard, non-portable extension.
It does not change the functionality of strcpy, which is standard.
Same as _T, _tprintf, etc.


--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
.



Relevant Pages

  • Re: Destructor: not gauranteed to be called?
    ... >>> the ToStringmethod to a Char[] it returns with the EXACT SAME ... >>> the standard and might break someone's existing code. ... ToString is not part of the C++ ... The fact yhat you require or expect a Charto act as a string is a sign ...
    (microsoft.public.dotnet.languages.vc)
  • Re: byte order
    ... int am_i_little_endian{ ... Are you *absolutely* sure that's standard C, ... assuming a 8-bit char). ... The pointer casting rules specify that "It is guaranteed that ...
    (comp.lang.lisp)
  • Re: An Observation
    ... You execute it now or you execute it later. ... I explained CHAR and as I did in my prior post in ... complexity around and was not actually any simpler. ... because of the sloppiness of the standard. ...
    (comp.lang.forth)
  • Re: I want unsigned char * string literals
    ... within the text one should cast to unsigned char first. ... The original Standard tried to codify ... useless at this point. ... locale - no context object so it can't be safely used in libraries ...
    (comp.lang.c)
  • Re: Crazy stuff
    ... >>and the C standard states that it has the type array of char. ... C does not define "memory areas" at all. ...
    (comp.lang.c)