Due to the way inline works in c in gcc, I got errors building a debug 
build of libpano13 in fedora.

I know several different ways to fix the problem.  But I don't know enough 
about all the ways libpano13 might be built and/or used to have a safe 
opinion on which way is best.

Despite reading many results of google searches and official gcc 
descriptions, I still can't understand the general rules for inline in gcc 
c (which are very different from c++ rules).  But I do understand this 
example of the use of inline and why it is wrong.

Some questions:

Has anyone else built libpano13 debug in Linux?  Did you need to work 
around the problem described below?  If so, how?  If not, do you have an 
idea of why it worked for you and not for me?

Are the functions float2rgbe and rgbe2float supposed to be exposed to 
clients of libpano13?  Or are they purely internal?  Currently in Linux (at 
least the Fedora package and my own builds in Fedora) they are not 
exposed.  But I don't know if they were meant to be.  In fact they are not 
even exposed to the rest of libpano13 outside of rgbe.c, despite being 
declared in rgbe.h as if they were meant to be exposed.

As currently declared/defined they are never instantiated as individual 
functions.  They might be inlined wherever used within rgbe.c or they might 
be undefined.  That is entirely a free choice of the optimizer, except at 
lowest optimization level, where they are necessarily undefined.

My current work around:

I added  __attribute__((always_inline)) to the end of line 41 of 
pt_stdint.h (which is already inside a conditional excluding MSC).
That further entrenches the current behavior that c functions using the 
INLINE macro are not ever usable outside translation units that define 
them, while it fixes the undefines for unoptimized builds.  It forces 
functions defined that way to be inlined even in the debug build.

-- 
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
--- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to hugin-ptx+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/hugin-ptx/c51701bf-b0a0-4f89-ac91-6374b5c3afdcn%40googlegroups.com.

Reply via email to