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

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

Thread Previous | Thread Next
Vincent Pit
July 10, 2010 02:27
Re: [PATCH] Configure probe for static inline (version 2)
Message ID:

> 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
> 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 


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About