Skip to content

Commit f6b875c

Browse files
committed
Use __func__ instead of __FUNCTION__
The __FUNCTION__ is not part of the C99/C++11 standard. So replace all occurrences with the standard __func__. Side note: GCC 5.1 warns when using -Wpedantic -std=c99 and __FUNCTION__. JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
1 parent d988da8 commit f6b875c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

jerry-core/jrt/jrt.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ extern void __noreturn jerry_unimplemented (const char *comment, const char *fil
8888

8989
#ifndef JERRY_NDEBUG
9090
#define JERRY_ASSERT(x) do { if (__builtin_expect (!(x), 0)) { \
91-
jerry_assert_fail (#x, __FILE__, __FUNCTION__, __LINE__); } } while (0)
91+
jerry_assert_fail (#x, __FILE__, __func__, __LINE__); } } while (0)
9292
#else /* !JERRY_NDEBUG */
9393
#define JERRY_ASSERT(x) do { if (false) { (void)(x); } } while (0)
9494
#endif /* !JERRY_NDEBUG */
@@ -132,19 +132,19 @@ template<typename... values> extern void jerry_ref_unused_variables (const value
132132
#define JERRY_UNREACHABLE() \
133133
do \
134134
{ \
135-
jerry_unreachable (NULL, __FILE__, __FUNCTION__, __LINE__); \
135+
jerry_unreachable (NULL, __FILE__, __func__, __LINE__); \
136136
} while (0)
137137

138138
#define JERRY_UNIMPLEMENTED(comment) \
139139
do \
140140
{ \
141-
jerry_unimplemented (comment, __FILE__, __FUNCTION__, __LINE__); \
141+
jerry_unimplemented (comment, __FILE__, __func__, __LINE__); \
142142
} while (0)
143143

144144
#define JERRY_UNIMPLEMENTED_REF_UNUSED_VARS(comment, ...) \
145145
do \
146146
{ \
147-
jerry_unimplemented (comment, __FILE__, __FUNCTION__, __LINE__); \
147+
jerry_unimplemented (comment, __FILE__, __func__, __LINE__); \
148148
if (false) \
149149
{ \
150150
jerry_ref_unused_variables (0, __VA_ARGS__); \

jerry-libc/jerry-libc-defs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ libc_fatal (const char *msg,
3939

4040
#ifndef LIBC_NDEBUG
4141
# define LIBC_ASSERT(x) do { if (__builtin_expect (!(x), 0)) { \
42-
libc_fatal (#x, __FILE__, __FUNCTION__, __LINE__); } } while (0)
42+
libc_fatal (#x, __FILE__, __func__, __LINE__); } } while (0)
4343
# define LIBC_UNREACHABLE() \
4444
do \
4545
{ \
46-
libc_fatal ("Code is unreachable", __FILE__, __FUNCTION__, __LINE__); \
46+
libc_fatal ("Code is unreachable", __FILE__, __func__, __LINE__); \
4747
} while (0)
4848
#else /* !LIBC_NDEBUG */
4949
# define LIBC_ASSERT(x) do { if (false) { (void) (x); } } while (0)

jerry-libc/target/linux/jerry-libc-target.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ LIBC_UNREACHABLE_STUB_FOR (int raise (int sig_no __attr_unused___))
4848
#define LIBC_EXIT_ON_ERROR(syscall_ret_val) \
4949
if ((syscall_ret_val) < 0) \
5050
{ \
51-
libc_fatal ("Syscall", __FILE__, __FUNCTION__, __LINE__); \
51+
libc_fatal ("Syscall", __FILE__, __func__, __LINE__); \
5252
}
5353

5454
static long int syscall_0 (long int syscall_no);

0 commit comments

Comments
 (0)