Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-02-09 23:58:33 +0400
committerEric Blake <eblake@redhat.com>2012-02-09 23:58:33 +0400
commit833630b85933b9cdcdfe0e4af97fec93f775b3b6 (patch)
tree33415d8985bae773afa810f8f60ae8c35f5bceb3 /newlib
parent3b20fd9324ccbdf57c3ba098f7dab4d930e98303 (diff)
* libc/include/_ansi.h (_ELIDABLE_INLINE): Fix C99 mode.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog4
-rw-r--r--newlib/libc/include/_ansi.h23
2 files changed, 17 insertions, 10 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index e0e6b5449..b08a422a9 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,7 @@
+2012-02-09 Eric Blake <eblake@redhat.com>
+
+ * libc/include/_ansi.h (_ELIDABLE_INLINE): Fix C99 mode.
+
2012-02-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/sys/rtems/sys/utime.h: Include <sys/types.h> to provide a
diff --git a/newlib/libc/include/_ansi.h b/newlib/libc/include/_ansi.h
index e584ec385..86cb82b35 100644
--- a/newlib/libc/include/_ansi.h
+++ b/newlib/libc/include/_ansi.h
@@ -113,21 +113,24 @@
to emit the function body unless the address is explicitly
taken. However this behaviour is changing to match the C99
standard, which uses 'extern inline' to indicate that the
- function body *must* be emitted. If we are using GCC, but do
- not have the new behaviour, we need to use extern inline; if
- we are using a new GCC with the C99-compatible behaviour, or
- a non-GCC compiler (which we will have to hope is C99, since
- there is no other way to achieve the effect of omitting the
- function if it isn't referenced) we just use plain 'inline',
- which c99 defines to mean more-or-less the same as the Gnu C
- 'extern inline'. */
+ function body *must* be emitted. Likewise, a function declared
+ without either 'extern' or 'static' defaults to extern linkage
+ (C99 6.2.2p5), and the compiler may choose whether to use the
+ inline version or call the extern linkage version (6.7.4p6).
+ If we are using GCC, but do not have the new behaviour, we need
+ to use extern inline; if we are using a new GCC with the
+ C99-compatible behaviour, or a non-GCC compiler (which we will
+ have to hope is C99, since there is no other way to achieve the
+ effect of omitting the function if it isn't referenced) we use
+ 'static inline', which c99 defines to mean more-or-less the same
+ as the Gnu C 'extern inline'. */
#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
/* We're using GCC, but without the new C99-compatible behaviour. */
#define _ELIDABLE_INLINE extern __inline__ _ATTRIBUTE ((__always_inline__))
#else
-/* We're using GCC in C99 mode, or an unknown compiler which
+/* We're using GCC in C99 mode, or an unknown compiler which
we just have to hope obeys the C99 semantics of inline. */
-#define _ELIDABLE_INLINE __inline__
+#define _ELIDABLE_INLINE static __inline__
#endif
#endif /* _ANSIDECL_H_ */