www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - tchar.h error in _stprintf

↑ ↓ ← 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
"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
→ "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
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
↑ ↓ 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
→ 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
→ "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:




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


 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
→ "Walter" <walter digitalmars.com> writes:
Fixed. -Walter
Jan 23 2004