[Xastir-dev] Any idea what libraries provide this?

Tom Russo russo at bogodyn.org
Sat Jul 9 15:59:57 PDT 2016


On Sat, Jul 09, 2016 at 03:51:02PM -0700, we recorded a bogon-computron collision of the <kf4lvz at acarver.net> flavor, containing:
> This actually came up sometime in 2007 because of the gcc changes.
> 
> One solution was in the following thread:
> 
> https://gcc.gnu.org/ml/gcc/2007-03/msg01099.html
> 
> Summarized as:
> 
> #if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
> #define ELIDABLE_INLINE extern inline
> #else
> #define ELIDABLE_INLINE inline
> #endif
> 
> Of course change extern to static for the current problems (apparently
> there was going to be another change to gcc that would affect 'extern').

The issue is related to C99 vs. GCC extensions.

The use of "static inline" as I suggested for functions that are defined
and only used in a single file is apparently the portable way to do it.

The behavior we're counting on in Xastir is apparently old GCC extension
style.  There are other ways to do it, such as defining the function 
in a header as inline int and then in the files where it's used declaring
it as extern inline, and yet a third way.  But these two functions are only
used in the same file where they're defined, and doing it via static inline
is probably the most straightforward and portable thing to do.

I have tested "static inline" using clang in both c89 and c99 
standards-compliant modes, and it works fine.  Then again, so did the
"inline int" version.

If "static inline int" works for these functions on cygwin, I will simply
push that change.

> On 2016-07-09 15:39, Tom Russo wrote:
> > On Sat, Jul 09, 2016 at 03:25:16PM -0700, we recorded a bogon-computron collision of the <davidf4 at mindspring.com> flavor, containing:
> >> Bingo!
> >>
> >> Now someone who has a lot more brains than me will need to figure out how to
> >> enforce this change for Cygwin systems...
> > 
> > Something else to try.
> > 
> > Replace "inline int" with "static inline int" on those two lines, instead
> > of removing "inline."  Does it still compile on Cygwin?
> > 
> > If so, then this is something we can do for all systems, without
> > special-casing Cygwin.
> > 
> > There was apparently a change in how GCC handles inline functions some
> > time ago, and perhaps this issue is a reflection of it.  That it still compiles
> > fine on real operating systems may just be luck.
> > 
> >> -----Original Message-----
> >> From: Tom Russo [mailto:russo at bogodyn.org]
> >> Sent: Saturday, July 09, 2016 2:20 PM
> >>
> >> Perhaps the declaration as inline is what's causing the problem.  Try
> >> removing the inline qualifier from the two function declarations (main.c,
> >> line 5174 for no_data_selected, and maps.c, line 231 for max_i) and see if
> >> that helps.
> >>
> >>
> > 
> 
> _______________________________________________
> Xastir-dev mailing list
> Xastir-dev at lists.xastir.org
> http://xastir.org/mailman/listinfo/xastir-dev

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236        http://kevan.org/brain.cgi?DDTNM
 echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z] [n-z][a-m]

 




More information about the Xastir-dev mailing list