<html>#484: CCTK_CHECK_C_INLINE can define away the inline keyword
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Roland Haas</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>closed</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Cactus</td></tr>
</table>

<p>Changes (by Roland Haas):</p>
<p>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 </p>
<div class="codehilite"><pre><span></span>#define inline
</pre></div>


<p>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. </p>
<p>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.</p>
<p>I fix might be to do something like (in aclocal.m4 instead of #defining inline):<br />
AC_DEFINE(CCTK_GNU_C_INLINE, )<br />
and<br />
AC_DEFINE_UNQUOTED(CCTK_GNU_C_INLINE,  $cctk_cv_c_inline)<br />
the way that CCTK_CHECK_C_STATIC_INLINE does, instead of redefining a reserved language keyword.<br />
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''' <code>inline</code> and not e.g. <code>__inline__</code> or <code>__inline</code> or <code>__inline__ __attribute__((__gnu_inline__))</code> that configure also tests for.</p>
<p><strong>Keyword:</strong></p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/484/cctk_check_c_inline-can-define-away-the'>https://bitbucket.org/einsteintoolkit/tickets/issues/484/cctk_check_c_inline-can-define-away-the</a></p>
</html>