This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
void* vs void *
- From: Magnus Fromreide <magfr at lysator dot liu dot se>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 29 Jan 2016 19:13:00 +0100
- Subject: void* vs void *
- Authentication-results: sourceware.org; auth=none
I just noticed that the C and C++ compiler output pointer types differently:
Consider
int i;
printf("%p", &i);
When compiled as C that gives the warning
format '%p' expects argument of type 'void *', but argument 2 has type 'int *'
but when compiled as C++ it gives the warning
format '%p' expects argument of type 'void*', but argument 2 has type 'int*'
Why are they different?
/MF