|
From: Julian S. <js...@ac...> - 2004-07-17 14:01:25
|
(This is probably a question for Jeremy really ...) I was trying to build with Icc 8 and got a bunch of link errors concerning duplicate definitions of VALGRIND_PRINTF, VALGRIND_PRINTF_BACKTRACE, VALGRIND_INTERNAL_PRINTF and VALGRIND_INTERNAL_PRINTF_BACKTRACE. All 4 of these are defined (not merely declared) in header files, and all with the "weak" attribute. I suspect that somehow gcc honours the weak attribute and so linking works out, throwing away duplicate appearances, whereas icc somehow does not. However, I wondered why these fns are defined in header files. Presumably there's something special about the arrangments which preclude putting the definitions in a .c file somewhere? Pls advise ... J |
|
From: Robert W. <rj...@du...> - 2004-07-17 14:16:14
|
On Sat, 2004-07-17 at 07:03, Julian Seward wrote:=20 > (This is probably a question for Jeremy really ...) Me, actually. I did those originally. > I was trying to build with Icc 8 and got a bunch of link errors > concerning duplicate definitions of VALGRIND_PRINTF,=20 > VALGRIND_PRINTF_BACKTRACE, VALGRIND_INTERNAL_PRINTF > and VALGRIND_INTERNAL_PRINTF_BACKTRACE. All 4 of these > are defined (not merely declared) in header files, and > all with the "weak" attribute. >=20 > I suspect that somehow gcc honours the weak attribute and > so linking works out, throwing away duplicate appearances, > whereas icc somehow does not. However, I wondered why > these fns are defined in header files. Presumably there's > something special about the arrangments which preclude=20 > putting the definitions in a .c file somewhere? Yeah - they use varargs, which doesn't work very well with preprocessor macros and what I needed to do. I hate this hack anyway, so perhaps it's time to rethink how these can be done. (If anyone has suggestions, I'd love to hear them.) Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |
|
From: Tom H. <th...@cy...> - 2004-07-17 14:28:03
|
In message <109...@dr...>
Robert Walsh <rj...@du...> wrote:
> On Sat, 2004-07-17 at 07:03, Julian Seward wrote:
>
> > I was trying to build with Icc 8 and got a bunch of link errors
> > concerning duplicate definitions of VALGRIND_PRINTF,
> > VALGRIND_PRINTF_BACKTRACE, VALGRIND_INTERNAL_PRINTF
> > and VALGRIND_INTERNAL_PRINTF_BACKTRACE. All 4 of these
> > are defined (not merely declared) in header files, and
> > all with the "weak" attribute.
> >
> > I suspect that somehow gcc honours the weak attribute and
> > so linking works out, throwing away duplicate appearances,
> > whereas icc somehow does not. However, I wondered why
> > these fns are defined in header files. Presumably there's
> > something special about the arrangments which preclude
> > putting the definitions in a .c file somewhere?
>
> Yeah - they use varargs, which doesn't work very well with preprocessor
> macros and what I needed to do. I hate this hack anyway, so perhaps
> it's time to rethink how these can be done. (If anyone has suggestions,
> I'd love to hear them.)
Wouldn't making them inline rather than weak have the desired effect?
Of course in C99 (and earlier in gcc) you can have varargs macros.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Julian S. <js...@ac...> - 2004-07-17 23:22:06
|
On Saturday 17 July 2004 15:16, Robert Walsh wrote: > On Sat, 2004-07-17 at 07:03, Julian Seward wrote: > > (This is probably a question for Jeremy really ...) > > Me, actually. I did those originally. Oh. Apologies Jeremy. > > I suspect that somehow gcc honours the weak attribute and > > so linking works out, throwing away duplicate appearances, > > whereas icc somehow does not. However, I wondered why > > these fns are defined in header files. Presumably there's > > something special about the arrangments which preclude > > putting the definitions in a .c file somewhere? > > Yeah - they use varargs, which doesn't work very well with preprocessor > macros and what I needed to do. I hate this hack anyway, so perhaps > it's time to rethink how these can be done. (If anyone has suggestions, > I'd love to hear them.) Putting "static" on those fns sorts it out (kludgily) and some other stuff is kludgable around too. However, Icc 8 doesn't seem to recognise __builtin_setjmp / __builtin_longjmp, which is (a) strange considering I'm sure I remember Icc 7 doing so, and (b) fatal, since the scheduler/dispatcher use them to catch exceptions in generated code. So that puts the tin hat on that one. Bah. J |