aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2015-09-25 14:24:11 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2015-09-25 14:24:11 +0000
commit41d9f1e0397b3661f765d21d8397e2a54aa4cd55 (patch)
tree21100e9b2f3e1a93346e76fdaba64fa8547b8ad1 /gcc/fortran/resolve.c
parentf700c7caef3feffdadcac957ac92f8c5d8470270 (diff)
downloadgcc-41d9f1e0397b3661f765d21d8397e2a54aa4cd55.zip
gcc-41d9f1e0397b3661f765d21d8397e2a54aa4cd55.tar.gz
gcc-41d9f1e0397b3661f765d21d8397e2a54aa4cd55.tar.bz2
PR pretty-print/67567 do not pass NULL as a string
Fortran passes NULL where a non-null string is expected by the pretty-printer, which causes a sanitizer warning. This could have been found earlier by using gcc_checking_assert. Even if the assertion is false, the result is just an incomplete diagnostic, thus it seems more user-friendly to assert only when checking. I do not have any idea how to properly fix the Fortran bug, thus this patch simply works-around it. gcc/fortran/ChangeLog: 2015-09-25 Manuel López-Ibáñez <manu@gcc.gnu.org> PR pretty-print/67567 * resolve.c (resolve_fl_procedure): Work-around when iface->module == NULL. gcc/ChangeLog: 2015-09-25 Manuel López-Ibáñez <manu@gcc.gnu.org> PR pretty-print/67567 * pretty-print.c (pp_string): Add gcc_checking_assert. * pretty-print.h (output_buffer_append_r): Likewise. From-SVN: r228131
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 7363e06..59cf034 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -11743,7 +11743,10 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{
gfc_error ("Mismatch in PURE attribute between MODULE "
"PROCEDURE at %L and its interface in %s",
- &sym->declared_at, iface->module);
+ &sym->declared_at,
+ /* FIXME: PR fortran/67567: iface->module should
+ not be NULL ! */
+ iface->module ? iface->module : "");
return false;
}
@@ -11759,7 +11762,10 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{
gfc_error ("Mismatch in RECURSIVE attribute between MODULE "
"PROCEDURE at %L and its interface in %s",
- &sym->declared_at, iface->module);
+ &sym->declared_at,
+ /* FIXME: PR fortran/67567: iface->module should
+ not be NULL ! */
+ iface->module ? iface->module : "");
return false;
}
@@ -11768,7 +11774,10 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{
gfc_error ("%s between the MODULE PROCEDURE declaration "
"in module %s and the declaration at %L in "
- "SUBMODULE %s", errmsg, iface->module,
+ "SUBMODULE %s", errmsg,
+ /* FIXME: PR fortran/67567: iface->module should
+ not be NULL ! */
+ iface->module ? iface->module : "",
&sym->declared_at, sym->ns->proc_name->name);
return false;
}