c compiler using wrong options

Back to General discussions forum

Dylan-Brotherston     2017-06-07 15:04:45

There doesn't seem to be a way to report bugs so i will leave this here.

While trying to submit Problem 21, the compiler throws this error:

invalid conversion from ‘void*’ to ‘int*’ [-fpermissive]

which is hard to read but definitely has something to do with the -fpermissive compiler option.
But my code is in c not c++, and therefore -fpermissive isn't valid.

is this a known bug??

Quandray     2017-06-07 16:36:02
User avatar

Hi,

Sorry, I can't do anything to make that easier to read.

However, the error can be removed by using a cast to convert the pointer returned by malloc to the required type.

int *nums = (int*) malloc(sizeof(int)*(max+1));
Dylan-Brotherston     2017-06-08 03:30:20

Thanks very much Quandray.

Please login and solve 5 problems to be able to post at forum