develooper Front page | perl.perl5.porters | Postings from July 2010

Re: [PATCH] Configure probe for static inline (version 2)

Thread Previous | Thread Next
From:
Vincent Pit
Date:
July 10, 2010 02:27
Subject:
Re: [PATCH] Configure probe for static inline (version 2)
Message ID:
4C383CF8.1080801@profvince.com

> Here is a proposed patch to enable Configure to probe for C99-style
> 'static inline'.  (That is, functions may be inlined, but will not be
> externally visible.)  The initial idea is that some common code in messy
> macros inside headers might be simplified using inline functions.  If the
> compiler does not support 'static inline', then a plain 'static' is used
> instead, along with the consequent implications of a function call.  In
> either case, you simply use  PERL_STATIC_INLINE.
>
> This patch differs from the first version in that it allows for other
> spellings of "inline", including "__inline__" (useful even under gcc
> -ansi, which cflags.SH will "helpfully" try to invoke), and, for
> completeness, "__inline" and "_inline", which are variations used by
> recent and older Microsoft compilers, and possibly some other
> compilers too.
>
> I'd appreciate it if folks could give this a try and let me know of
> any problems.  You don't need metaconfig at all -- this patch applies
> directly to bleadperl.  Specifically, after you run Configure as
> usual, grep for 'd_static_inline' and 'perl_static_inline" in config.sh
> and see if they match what you think they should be.

As expected, icc 10.1 picks "static inline" in C99 (or default) mode, 
and "static __inline__" in ANSI mode. But I believe that icc 8 or 9 used 
to prefer "static __inline".

clang 1.1 wants "static __inline__" in ANSI (and default) mode. I'm not 
sure it even has a C99 mode, as "-std=c99" also results in "static 
__inline__".

Vincent.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About