[PATCH] Fix inline functions to use 'static inline'

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-sdr@lists.osmocom.org/.

Müller, Marcus (CEL) mueller at kit.edu
Fri Jun 29 08:25:01 UTC 2018


Hi David, Pinky, Steve and all,

I'd agree with "uh, I need to know where this goes wrong please, I'm
scared". I'd also agree, an inlined function should probably have
compilation unit scope, anyway, so `static` would be appropriate.

I've taken a look at the patched function declarations and would
recommend to just remove `min16` and `max16` alltogether (only used in
a comment, and frankly, not that great a function `(a<>b?a:b)`). 

I'd really like to know the compile error! Maybe there's actually
something we can do – simply because this really *shouldn't* fail,
imho.

Best regards,
Marcus

On Thu, 2018-06-28 at 20:50 +0200, Pinky wrote:
> Hi all,
> 
> althought the argument about compiller is a bit strange the change is
> in
> my opinion in right course. If the goal is to use those functions
> only in this
> one particular .c file and not elsewhere, the good practice is to
> limit scope by using static.
> 
> Can You please let us know how to reproduce behaviour You have
> described?
> 
> with best regards,
>     Pinky.
> 
> 
> * Steve Markgraf <steve at steve-m.de> [2018-06-28 20:29:34 +0200]:
> 
> > Hi David,
> > 
> > On 28.06.2018 17:43, David Woodhouse wrote:
> > > With just 'inline', if the compiler decides not to inline them,
> > > it isn't
> > > required to emit them at all. For some targets with -Os that is
> > > causing
> > > build failures.
> > 
> > "It isn't required to emit them at all" - What the heck, which
> > compiler
> > on earth does such horrible things?
> > 
> > I've taken at look at the C99 standard for the function specifier
> > 'inline' and there is nothing that would justify such behaviour.
> > 
> > Of course, if that's a bug with a specific compiler version we can
> > merge
> > that, but the explanation in the commit doesn't make any sense to
> > me.
> > 
> > Regards,
> > Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6582 bytes
Desc: not available
URL: <http://lists.osmocom.org/pipermail/osmocom-sdr/attachments/20180629/864b74fb/attachment.bin>


More information about the osmocom-sdr mailing list