From mboxrd@z Thu Jan 1 00:00:00 1970 From: albaugh@agames.com (Mike Albaugh) To: help-gcc@gnu.org Subject: Re: Linking problems, mangling ? Date: Thu, 16 Dec 1999 11:06:00 -0000 Message-id: <83bcc9$s2p$1@null.agames.com> References: <83askq$dhu$1@news.stna.dgac.fr> <83avtd$9bj$1@news.tue.nl> X-SW-Source: 1999-12/msg00252.html Eric Meijer (tgakem@pebbles.chem.tue.nl) wrote: : [...], and so on, so if the name mangling were made the same, your : programs would link against libraries provided from other compilers : but then crash when run. For this reason, the ARM encourages compiler : writers to make their name mangling different from that of other : compilers for the same platform. Incompatible libraries are then : detected at link time, rather than at run time. : ------------------------------------------------------------------------ : This means that you need to compile all C++ source in an application : with one and the same compiler. With C libraries this problem generally : doesn't exist. Beg to differ. On _many_ platforms, the C libraries from different vendors (and even from different switch settings to the same compiler) can and do differ in such things as parameter types, structure layouts, etc. Heck MSVC's "intrinsic" functions disagree with their own .h files, sometimes :-) Anyway, the result of these "bleeding ends" is not typically detected at link time, but either at compile time (_if_ the programmer cranks warnings up high enough _and_ the .h files are complete and correct) or at run-time, where they manifest themselves as obscure behavior. Mike | albaugh@agames.com, speaking only for myself From mboxrd@z Thu Jan 1 00:00:00 1970 From: albaugh@agames.com (Mike Albaugh) To: help-gcc@gnu.org Subject: Re: Linking problems, mangling ? Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: <83bcc9$s2p$1@null.agames.com> References: <83askq$dhu$1@news.stna.dgac.fr> <83avtd$9bj$1@news.tue.nl> X-SW-Source: 1999-12n/msg00252.html Message-ID: <19991231222400.W3D35e1j62vtUnsR3gzGR6FzklmIfMx5EwpYYJF9XAA@z> Eric Meijer (tgakem@pebbles.chem.tue.nl) wrote: : [...], and so on, so if the name mangling were made the same, your : programs would link against libraries provided from other compilers : but then crash when run. For this reason, the ARM encourages compiler : writers to make their name mangling different from that of other : compilers for the same platform. Incompatible libraries are then : detected at link time, rather than at run time. : ------------------------------------------------------------------------ : This means that you need to compile all C++ source in an application : with one and the same compiler. With C libraries this problem generally : doesn't exist. Beg to differ. On _many_ platforms, the C libraries from different vendors (and even from different switch settings to the same compiler) can and do differ in such things as parameter types, structure layouts, etc. Heck MSVC's "intrinsic" functions disagree with their own .h files, sometimes :-) Anyway, the result of these "bleeding ends" is not typically detected at link time, but either at compile time (_if_ the programmer cranks warnings up high enough _and_ the .h files are complete and correct) or at run-time, where they manifest themselves as obscure behavior. Mike | albaugh@agames.com, speaking only for myself