ryu icon indicating copy to clipboard operation
ryu copied to clipboard

Remove the "static inline" declarator

Open chirsz-ever opened this issue 2 years ago • 3 comments

It looks like unnecessary, and makes the source rejected by compilers that do not support C99, for example, Visual Studio 2012.

chirsz-ever avatar Sep 17 '21 15:09 chirsz-ever

If you think that's good, I could make a PR.

chirsz-ever avatar Sep 17 '21 16:09 chirsz-ever

I know this will sound bad but please please DO NOT do that. You can make that change in your fork, most git stuff is smart enough to be able to keep that change intact as you take the very rarely occurring updates. VS 2012 is an ancient product. We should not decrease the quality of the code to support such systems. It is not unnecessary BTW. It removes symbols that matters a lot for for large scale systems, the inline keyword also changes the semantics as far as I understand.

C99 is 22 years old now. So the only change that makes sense to me in this regard (if we were to change anything to support a obsolete products) is to add conditional compilation (#if !defined(_MSVC_VER) || _MSVC_VER > 1?00) around the static inline stuff.

I know I sound like a j3rk, it is a birth defect, I apologize. I am saying that anything that does not support C99 is obsolete because even the I-don't-want-to-tocuh-it-with-a-10-foot-pole old big iron compilers (IBM AIX, Oracle Sun Studio) that can't even do C++03 right support C99 well enough for this code for ages.

@chirsz-ever Would that #if thing be something you could live with? (Of course I don't make the decisions here. I am just trying to find a solution that works for everyone.) The other possibility would be to make a dedicated configuration macro so you could -DULFJACK_RYU_USE_NO_STATIC_INLINE so anyone can control it any way they want.

cppguru avatar Sep 17 '21 16:09 cppguru

I'm not a conservative and I like modern C, but it might be too radical for me to use so many static inline functions.

The idea of conditional compilation looks good.

chirsz-ever avatar Sep 18 '21 02:09 chirsz-ever