Compile error: 'vswprintf': Too few arguments for call in IPP 6.1 sample code

Source: Internet
Author: User

In the compile process of IPP 6.1 sample code-audio-video-codecs, an error is reported:

Vm_file_win.c (1173): Error c2198: 'vswprintf': Too few arguments for call

Vswprintf is a macro. by viewing the definition of vswprintf, we can find that there are different definitions in its VC installation directory:

Int _ cdecl _ vswprintf (
Wchar_t * string,
Const wchar_t * format,
Va_list AP
);

Int _ cdecl vswprintf (
Wchar_t * string,
Size_t count,
Const wchar_t * format,
Va_list AP
);

The difference is that the latter has an additional parameter "size_t count", indicating the maximum length allowed by the buffer.

Here is an explanation in msdn:

In Visual C ++ 2005,SwprintfConforms to the iso c standard, which requires the second parameter,
Count, of TypeSize_t. To force the old nonstandard behavior, define
_ Crt_non_conforming_swprintfs. In a future version, the old behavior may be removed, so code shocould be changed to use the new conformant behavior.

Therefore, the latter is designed to be compatible with iso c standard. If you need to use an older version provided by Microsoft, you need to add the macro definition:

_ Crt_non_conforming_swprintfs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.