www.digitalmars.com         C & C++   DMDScript  

c++ - tchar.h error in _stprintf

reply Wu Yongwei <Wu_member pathlink.com> writes:
Line 345 of tchar.h is wrong. It is

#define _stprintf	_snprintf

while it should be

#define _stprintf	sprintf

Best regards,

Wu Yongwei
Jan 01 2004
next sibling parent reply "Walter" <walter digitalmars.com> writes:
No, I think _snprintf is right. Things are moving towards checked buffer
sizes, and sprintf is not checked.

"Wu Yongwei" <Wu_member pathlink.com> wrote in message
news:bt325l$1982$1 digitaldaemon.com...
 Line 345 of tchar.h is wrong. It is

 #define _stprintf _snprintf

 while it should be

 #define _stprintf sprintf

 Best regards,

 Wu Yongwei
Jan 03 2004
next sibling parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
 No, I think _snprintf is right. Things are moving towards checked buffer
 sizes, and sprintf is not checked.
Still sounds wrong to me. Wouldn't it be _stnprintf? It's not a subtle change; it will break code.
 "Wu Yongwei" <Wu_member pathlink.com> wrote in message
 news:bt325l$1982$1 digitaldaemon.com...
 Line 345 of tchar.h is wrong. It is

 #define _stprintf _snprintf

 while it should be

 #define _stprintf sprintf

 Best regards,

 Wu Yongwei
Jan 03 2004
prev sibling parent reply Wu Yongwei <Wu_member pathlink.com> writes:
I don't think so.  Check MSDN:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_sprintf.2c_.swprintf.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__snprintf.2c_._snwprintf.asp

It is _sntprintf that maps to _snprintf, but not _stprintf. Your include file
BREAKS code.

Best regards,

Wu Yongwei

In article <bt886a$2t6r$1 digitaldaemon.com>, Walter says...
No, I think _snprintf is right. Things are moving towards checked buffer
sizes, and sprintf is not checked.

"Wu Yongwei" <Wu_member pathlink.com> wrote in message
news:bt325l$1982$1 digitaldaemon.com...
 Line 345 of tchar.h is wrong. It is

 #define _stprintf _snprintf

 while it should be

 #define _stprintf sprintf

 Best regards,

 Wu Yongwei
Jan 14 2004
parent reply Jan Knepper <jan smartsoft.us> writes:
Check the STANDARD... I think MSDN has this wrong!



Wu Yongwei wrote:

 I don't think so.  Check MSDN:
 
 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_sprintf.2c_.swprintf.asp
 
 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__snprintf.2c_._snwprintf.asp
 
 It is _sntprintf that maps to _snprintf, but not _stprintf. Your include file
 BREAKS code.
 
 Best regards,
 
 Wu Yongwei
 
 In article <bt886a$2t6r$1 digitaldaemon.com>, Walter says...
 
No, I think _snprintf is right. Things are moving towards checked buffer
sizes, and sprintf is not checked.

"Wu Yongwei" <Wu_member pathlink.com> wrote in message
news:bt325l$1982$1 digitaldaemon.com...

Line 345 of tchar.h is wrong. It is

#define _stprintf _snprintf

while it should be

#define _stprintf sprintf

Best regards,

Wu Yongwei
-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Jan 15 2004
next sibling parent Wu Yongwei <Wu_member pathlink.com> writes:
Sorry, what standard?! The C standard never mentions anything about tchar.h or
_stprintf. In fact, the prefixing underscore in the name "_stprintf" has already
told you that it is NON-standard.

The whole tchar stuff is defined by Microsoft. Microsoft IS the standard, in
this case. I never see any Win32 compiler other than DMC deviate from the MSDN
documentation. I have checked with MSVC, MinGW GCC, and BCC. This behaviour is
specific to DMC and BREAKS code!

Regards,

Wu Yongwei

In article <bu69s9$2br8$1 digitaldaemon.com>, Jan Knepper says...
Check the STANDARD... I think MSDN has this wrong!



Wu Yongwei wrote:

 I don't think so.  Check MSDN:
 
 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_sprintf.2c_.swprintf.asp
 
 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__snprintf.2c_._snwprintf.asp
 
 It is _sntprintf that maps to _snprintf, but not _stprintf. Your include file
 BREAKS code.
 
 Best regards,
 
 Wu Yongwei
 
 In article <bt886a$2t6r$1 digitaldaemon.com>, Walter says...
 
No, I think _snprintf is right. Things are moving towards checked buffer
sizes, and sprintf is not checked.

"Wu Yongwei" <Wu_member pathlink.com> wrote in message
news:bt325l$1982$1 digitaldaemon.com...

Line 345 of tchar.h is wrong. It is

#define _stprintf _snprintf

while it should be

#define _stprintf sprintf
Jan 16 2004
prev sibling parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
I've just looked in the standard, and there is no ???tprintf. Are you
walking about an amendment? If so, what is it? I find it *really* hard to
believe that DMC++ has it correct.

"Jan Knepper" <jan smartsoft.us> wrote in message
news:bu69s9$2br8$1 digitaldaemon.com...
 Check the STANDARD... I think MSDN has this wrong!



 Wu Yongwei wrote:

 I don't think so.  Check MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_sprintf.2c_.swprintf.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__snprintf.2c_._snwprintf.asp
 It is _sntprintf that maps to _snprintf, but not _stprintf. Your include
file
 BREAKS code.

 Best regards,

 Wu Yongwei

 In article <bt886a$2t6r$1 digitaldaemon.com>, Walter says...

No, I think _snprintf is right. Things are moving towards checked buffer
sizes, and sprintf is not checked.

"Wu Yongwei" <Wu_member pathlink.com> wrote in message
news:bt325l$1982$1 digitaldaemon.com...

Line 345 of tchar.h is wrong. It is

#define _stprintf _snprintf

while it should be

#define _stprintf sprintf

Best regards,

Wu Yongwei
-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Jan 16 2004
prev sibling parent "Walter" <walter digitalmars.com> writes:
Fixed. -Walter
Jan 23 2004