gcc-c++ handling of default arguments

Michael Cronenworth mike@cchtml.com
Mon Dec 8 15:28:00 GMT 2014


Hello,

I'm encountering an issue with gcc-c++ (4.9.2) and I'm not sure if it is a bug 
with gcc or the MinGW headers providing the functions.

error: default argument missing for parameter 9 of 'virtual HRESULT 
ISWbemLocator::ConnectServer(BSTR, BSTR, BSTR, BSTR, BSTR, BSTR, LONG, 
IDispatch*, ISWbemServices**)'
      virtual HRESULT STDMETHODCALLTYPE ConnectServer(
                                        ^

The function is defined as:

virtual HRESULT STDMETHODCALLTYPE ConnectServer(
BSTR strServer = L".",
BSTR strNamespace = L"",
BSTR strUser = L"",
BSTR strPassword = L"",
BSTR strLocale = L"",
BSTR strAuthority = L"",
LONG iSecurityFlags = 0,
IDispatch *objWbemNamedValueSet = 0,
ISWbemServices **objWbemServices) = 0;


On the surface the syntax looks correct, but gcc does not agree. Who is correct?

Thanks,
Michael



More information about the Gcc-help mailing list