NO

Author Topic: Missing prototype for 'fwprintf_s'  (Read 3283 times)

czerny

  • Guest
Missing prototype for 'fwprintf_s'
« on: April 24, 2011, 10:11:24 AM »
Hallo,

I got a warning #2027: Missing prototype for 'fwprintf_s
with ver 6 and with 6.5r4

The declaration in <wchar.h> is prefixed with the following macro

#define _CRTCHK(f,n,m)  __declspec(vaformat(f,n,m))

which is new since ver 6.

Is this a normal behaviour?

czerny

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2170
Re: Missing prototype for 'fwprintf_s'
« Reply #1 on: April 24, 2011, 11:21:28 AM »
From PellesC help Appendix ->  ISO TR24731-1:
To enable the extended functions in Pelles C, define the macro __STDC_WANT_LIB_EXT1__ as the integer constant 1.
Code: [Select]
#define __STDC_WANT_LIB_EXT1__ 1
#include <stdio.h>
#include <wchar.h>

int main(int argc, char **argv)
{
FILE *f;
f = stdout;
fwprintf_s(f, L"test\n");
wprintf_s(L"test\n");
return 0;
}
« Last Edit: April 24, 2011, 11:25:05 AM by timovjl »
May the source be with you