This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

extern "C" should not make a difference.



The following:

void f(unsigned char *(*)[][2]); 
produces:

t6.C:3: pointer or reference to array of unknown bound in parm type

But with extern "C" linkage, it compiles (even with -W -Wall -pedantic -ansi).

Stroustrup 3ed, 9.2.4, pg 206:
"In particular,a function declared extern "C" still obeys the C++ type
checking and argument conversion rules and not the weaker C rules."

It looks like egcs uses name mangling for error checking purposes.

Han Holl




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]