Pelles C forum

C language => Windows questions => Topic started by: Snowman on June 25, 2015, 11:20:14 PM

Title: warning #2228: Unable to expand function 'StringCbPrintfW' inline.
Post by: Snowman on June 25, 2015, 11:20:14 PM
Hello forum. I am using Pelles C version 8.00.60.
I am compiling the code below with speed optimizations and Level 2 warnings.

Code: [Select]
#define UNICODE
#define _UNICODE

#include <windows.h>
#include <tchar.h>
#include <strsafe.h>

int _tmain(void)
{
    TCHAR test[200];

    (void)StringCbPrintf(test, sizeof test, _T("Hello Windows API!"));
    return 0;
}

The warning in this thread's title is given if I use StringCbPrintf() but not if I use _sntprintf():
Code: [Select]
main.c(14): warning #2228: Unable to expand function 'StringCbPrintfW' inline.
My questions are:
Title: Re: warning #2228: Unable to expand function 'StringCbPrintfW' inline.
Post by: frankie on June 26, 2015, 03:17:17 PM
 
Title: Re: warning #2228: Unable to expand function 'StringCbPrintfW' inline.
Post by: ElectroDoc on July 01, 2015, 02:56:32 AM
You can simply change the warning level to 1 and see if this will 'hide' that warning.
Title: Re: warning #2228: Unable to expand function 'StringCbPrintfW' inline.
Post by: jj2007 on July 01, 2015, 08:39:51 AM
You can simply change the warning level to 1 and see if this will 'hide' that warning.

Better:
Code: [Select]
#pragma warn(disable:2228)
#include <strsafe.h>