how to handle "inline" with mipspro?
#1
how to handle "inline" with mipspro?
I'm getting myself confused again and am wondering if a wonderful soul can help un-confuse me.

so I learned a lot from this post https://forums.irix.cc/viewtopic.php?f=10&t=220&p=1337&hilit=inline#p1337, but let me go over it and make sure I fully understand. so prior to MIPSpro 7.4.4 (which is c99 compliant, via either using "c99" or "cc -c99"), when one comes across "inline" in code, one would have to replace it with "__inline"

same for "INLINE", replace with "__inline"

same for "__inline__" replace with "__inline"

I'm wondering what's the best way to handle various "inline" code I come across in open source software and not using c99 - should I just do:

export CPPFLAGS=" -Dinline=__inline -DINLINE=__inline -D__inline__=__inline"

with the above CPPFLAGS, if there is code that has "static inline", it gets replaced by "static __inline" correct?

so now lets say I have code that might or might not be c99 code, but I just go ahead and use "c99" or "cc -c99" in my enviroment, and I go ahead and used those CPPFLAGS just because why not, is this an issue?

lets say I do use those CPPFLAGS along with c99, and the code has a "#define __inline__" line(macro?)

for example I get this warning using c99 and the above CPPFLAGS:
Code:
cc-1047 cc: WARNING File = /usr/nekoware/include/SDL/begin_code.h, Line = 144
  Macro "__inline__" has an incompatible redefinition.

does this mean my CPPFLAGS line with "-D__inline__=__inline" overrides the define in the source code? What takes precedence, source's #define or my -D?
gijoe77
Tezro

Posts: 469
Threads: 28
Joined: Jun 2018
Find Reply
08-12-2018, 12:37 PM


Forum Jump:


Users browsing this thread: 1 Guest(s)