aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2014-07-07 09:13:48 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2014-07-07 09:13:48 +0000
commit77777b33a88e950ff1f7fc263e600a694816f468 (patch)
treecbd088b7bacddb90ca0051f9018f8994fbe6ebde /libgfortran
parent8adb5dc735298d2113de33ce442831f4dab9d215 (diff)
downloadgcc-77777b33a88e950ff1f7fc263e600a694816f468.zip
gcc-77777b33a88e950ff1f7fc263e600a694816f468.tar.gz
gcc-77777b33a88e950ff1f7fc263e600a694816f468.tar.bz2
stop.c: Use C11 _Noreturn.
* runtime/stop.c: Use C11 _Noreturn. * libgfortran.h: Use C11 _Noreturn in prototypes. Move REALPART, IMAGPART and COMPLEX_ASSIGN macros... * intrinsics/c99_functions.c: ... here. From-SVN: r212327
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog7
-rw-r--r--libgfortran/intrinsics/c99_functions.c7
-rw-r--r--libgfortran/libgfortran.h23
-rw-r--r--libgfortran/runtime/stop.c12
4 files changed, 26 insertions, 23 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 03f6f2ac..eef0b28 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,5 +1,12 @@
2014-07-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+ * runtime/stop.c: Use C11 _Noreturn.
+ * libgfortran.h: Use C11 _Noreturn in prototypes.
+ Move REALPART, IMAGPART and COMPLEX_ASSIGN macros...
+ * intrinsics/c99_functions.c: ... here.
+
+2014-07-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
* config/fpu-387.h, config/fpu-aix.h, config/fpu-sysv.h,
config/fpu-glibc.h: Use static assertions.
diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c
index 0e4589a..728ddb16 100644
--- a/libgfortran/intrinsics/c99_functions.c
+++ b/libgfortran/intrinsics/c99_functions.c
@@ -39,6 +39,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# endif
#endif
+/* Macros to get real and imaginary parts of a complex, and set
+ a complex value. */
+#define REALPART(z) (__real__(z))
+#define IMAGPART(z) (__imag__(z))
+#define COMPLEX_ASSIGN(z_, r_, i_) {__real__(z_) = (r_); __imag__(z_) = (i_);}
+
+
/* Prototypes are included to silence -Wstrict-prototypes
-Wmissing-prototypes. */
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index 8179cea..fa2fd83 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -235,11 +235,6 @@ extern int __mingw_snprintf (char *, size_t, const char *, ...)
#undef signbit
#define signbit(x) __builtin_signbit(x)
-/* TODO: find the C99 version of these an move into above ifdef. */
-#define REALPART(z) (__real__(z))
-#define IMAGPART(z) (__imag__(z))
-#define COMPLEX_ASSIGN(z_, r_, i_) {__real__(z_) = (r_); __imag__(z_) = (i_);}
-
#include "kinds.h"
/* Define the type used for the current record number for large file I/O.
@@ -693,7 +688,7 @@ iexport_proto(backtrace);
#define GFC_OTOA_BUF_SIZE (GFC_LARGEST_BUF * 3 + 1)
#define GFC_BTOA_BUF_SIZE (GFC_LARGEST_BUF * 8 + 1)
-extern void sys_abort (void) __attribute__ ((noreturn));
+extern _Noreturn void sys_abort (void);
internal_proto(sys_abort);
extern ssize_t estr_write (const char *);
@@ -709,26 +704,25 @@ internal_proto(st_printf);
extern const char *gfc_xtoa (GFC_UINTEGER_LARGEST, char *, size_t);
internal_proto(gfc_xtoa);
-extern void os_error (const char *) __attribute__ ((noreturn));
+extern _Noreturn void os_error (const char *);
iexport_proto(os_error);
extern void show_locus (st_parameter_common *);
internal_proto(show_locus);
-extern void runtime_error (const char *, ...)
- __attribute__ ((noreturn, format (gfc_printf, 1, 2)));
+extern _Noreturn void runtime_error (const char *, ...)
+ __attribute__ ((format (gfc_printf, 1, 2)));
iexport_proto(runtime_error);
-extern void runtime_error_at (const char *, const char *, ...)
- __attribute__ ((noreturn, format (gfc_printf, 2, 3)));
+extern _Noreturn void runtime_error_at (const char *, const char *, ...)
+ __attribute__ ((format (gfc_printf, 2, 3)));
iexport_proto(runtime_error_at);
extern void runtime_warning_at (const char *, const char *, ...)
__attribute__ ((format (gfc_printf, 2, 3)));
iexport_proto(runtime_warning_at);
-extern void internal_error (st_parameter_common *, const char *)
- __attribute__ ((noreturn));
+extern _Noreturn void internal_error (st_parameter_common *, const char *);
internal_proto(internal_error);
extern const char *translate_error (int);
@@ -875,8 +869,7 @@ internal_proto(filename_from_unit);
/* stop.c */
-extern void stop_string (const char *, GFC_INTEGER_4)
- __attribute__ ((noreturn));
+extern _Noreturn void stop_string (const char *, GFC_INTEGER_4);
export_proto(stop_string);
/* reshape_packed.c */
diff --git a/libgfortran/runtime/stop.c b/libgfortran/runtime/stop.c
index 7832ef8..8330b66 100644
--- a/libgfortran/runtime/stop.c
+++ b/libgfortran/runtime/stop.c
@@ -83,8 +83,7 @@ report_exception (void)
/* A numeric STOP statement. */
-extern void stop_numeric (GFC_INTEGER_4)
- __attribute__ ((noreturn));
+extern _Noreturn void stop_numeric (GFC_INTEGER_4);
export_proto(stop_numeric);
void
@@ -102,8 +101,7 @@ stop_numeric (GFC_INTEGER_4 code)
/* A Fortran 2008 numeric STOP statement. */
-extern void stop_numeric_f08 (GFC_INTEGER_4)
- __attribute__ ((noreturn));
+extern _Noreturn void stop_numeric_f08 (GFC_INTEGER_4);
export_proto(stop_numeric_f08);
void
@@ -136,8 +134,7 @@ stop_string (const char *string, GFC_INTEGER_4 len)
initiates error termination of execution." Thus, error_stop_string returns
a nonzero exit status code. */
-extern void error_stop_string (const char *, GFC_INTEGER_4)
- __attribute__ ((noreturn));
+extern _Noreturn void error_stop_string (const char *, GFC_INTEGER_4);
export_proto(error_stop_string);
void
@@ -154,8 +151,7 @@ error_stop_string (const char *string, GFC_INTEGER_4 len)
/* A numeric ERROR STOP statement. */
-extern void error_stop_numeric (GFC_INTEGER_4)
- __attribute__ ((noreturn));
+extern _Noreturn void error_stop_numeric (GFC_INTEGER_4);
export_proto(error_stop_numeric);
void