The code below doesnt throw any warnings while i compile
#include <iostream>
void GetHMACCode(unsigned char* buffer,long bufferLength,unsigned char** pResult,unsigned int &nResultLen){}
unsigned char *pCRCBufferptr ;
main() {
unsigned char *pHMAC = NULL;
int ncrcDataLength;
unsigned int nHMACLen = 0;
GetHMACCode(pCRCBufferptr,ncrcDataLength,&pHMAC,nHMACLen);
}
But When i add an extra argument in the function (not in the function call), I get the below warning
myFile.cpp: In function ‘int main()’:
myFile.cpp:11: warning: deprecated conversion from string constant to ‘char*’
Added extra arguement in the function
#include <iostream>
void GetHMACCode(unsigned char* buffer,long bufferLength,unsigned char** pResult,unsigned int &nResultLen,char *extra_arg = "11111111111111111111"){}
unsigned char *pCRCBufferptr ;
main() {
unsigned char *pHMAC = NULL;
int ncrcDataLength;
unsigned int nHMACLen = 0;
GetHMACCode(pCRCBufferptr,ncrcDataLength,&pHMAC,nHMACLen);
}
I am confused why this warnign is being thrown
Thanks Tejas