NO

Author Topic: Difference in the library for wprintf between Pelles C and Microsoft  (Read 2676 times)

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
When I compile and run the following program
Code: [Select]
#include <windows.h>
#include <wchar.h>
PWSTR   Brackets1 = L"(%s)\n";
PWSTR   Brackets2 = L"(%ls)\n";
int main()
{
wprintf(Brackets1, L"Hello");
wprintf(Brackets2, L"Hello");
return 0;
}
I get with Pelles C and Pelles runtime the following result:

(H)
(Hello)


With Pelles C and linking with msvcrt.lib, lcc-win32, MinGW (gcc 4.4.0) and Visual C++ 2008 Express Edition I get:
(Hello)
(Hello)


I think this is a differance in the hole family of wprintf-functions. I think not that the kind how Pelles runtime-function works is wrong. I just want to say, that there is a diffence and the most time Pelle tries to be compatible with the Microsoft products.

best regards
 Alex ;)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
This has been discussed before, and I strongly prefer the standard C way (so much that I'm unwilling to change it).
/Pelle

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
This has been discussed before, and I strongly prefer the standard C way (so much that I'm unwilling to change it).
Is OK. And if somebody will use the Microsoft way of runtime, there is a tool (Dll2Inc) from Vortex (http://www.vortex.masmcode.com/) to create a msvcrt.def and with polib a msvcrt.lib from the def-file.
best regards
 Alex ;)