[ET Trac] [Einstein Toolkit] #484: CCTK_CHECK_C_INLINE can define away the inline keyword

Einstein Toolkit trac-noreply at einsteintoolkit.org
Wed Aug 3 16:38:21 CDT 2011


#484: CCTK_CHECK_C_INLINE can define away the inline keyword
--------------------+-------------------------------------------------------
 Reporter:  rhaas   |       Owner:     
     Type:  defect  |      Status:  new
 Priority:  minor   |   Milestone:     
Component:  Cactus  |     Version:     
 Keywords:          |  
--------------------+-------------------------------------------------------
 CCTK_CHECK_C_INLINE tests for an inline keyword that satifies the old pre
 C99 inline semantics of gcc (gcc pre 4.3 and in particular pre 4.6). If it
 does not find an inline that behaves like that (which happens eg. with the
 pgi compiler which does not try to emulate gcc) then configure actually
 puts a

 #define inline

 into cctk_Config.h. This removes the keyword from the language turning eg.
 things like "static inline" into just "static" and the only inlining that
 happens will be due to the optimizer deciding so.

 The reason given for this in aclocal.m4 is the standard conforming
 behaviour is "incompatible with many libraries, leading to linker errors
 about duplicate symbols." This does no longer seem to be the case, at
 least I can compile the ET thornlist fine without this redefinition.

 I fix might be to do something like (in aclocal.m4 instead of #defining
 inline):
 AC_DEFINE(CCTK_GNU_C_INLINE, )
 and
 AC_DEFINE_UNQUOTED(CCTK_GNU_C_INLINE,  $cctk_cv_c_inline)
 the way that CCTK_CHECK_C_STATIC_INLINE does, instead of redefining a
 reserved language keyword.
 This would also affect the "#ifndef inline" part in cctk.h line 180, which
 currently seems to behave strangely in any case unless the keyword
 detected by configure is '''exactly''' {{{inline}}} and not e.g.
 {{{__inline__}}} or {{{__inline}}} or {{{__inline__
 __attribute__((__gnu_inline__))}}} that configure also tests for.

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/484>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list