* [patch, fortran] PR24633, improve diagnostic message
@ 2007-04-30 12:15 Daniel Franke
2007-05-18 12:20 ` Ping: " Daniel Franke
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Franke @ 2007-04-30 12:15 UTC (permalink / raw)
To: fortran, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 889 bytes --]
Subroutines or functions named as their containing module or program are
reported as
subroutine abc()
1
Error: MODULE attribute conflicts with PROCEDURE attribute at (1)
Attached patch checks whether a NAME is available. If yes, it is added to the
message:
subroutine abc()
1
Error: MODULE attribute of 'abc' conflicts with PROCEDURE attribute at (1)
A similar distinction as the one proposed is made in symbol.c:602.
:ADDPATCH fortran:
2007-04-30 Daniel Franke <franke.daniel@gmail.com>
* symbol.c (gfc_add_flavor): Add the NAME to error message if available.
As it is a minor clarification within a message only, no additional testcase
is included.
Tested on i686-pc-linux-gnu, no regressions. Ok for mainline?
Daniel
P.S. In general, should changes like this be backported to 4.2(.1) as well,
although they are not actually regressions?
[-- Attachment #2: pr24633.patch --]
[-- Type: text/x-diff, Size: 776 bytes --]
Index: symbol.c
===================================================================
--- symbol.c (revision 124274)
+++ symbol.c (working copy)
@@ -1155,9 +1155,14 @@
if (where == NULL)
where = &gfc_current_locus;
- gfc_error ("%s attribute conflicts with %s attribute at %L",
- gfc_code2string (flavors, attr->flavor),
- gfc_code2string (flavors, f), where);
+ if (name)
+ gfc_error ("%s attribute of '%s' conflicts with %s attribute at %L",
+ gfc_code2string (flavors, attr->flavor), name,
+ gfc_code2string (flavors, f), where);
+ else
+ gfc_error ("%s attribute conflicts with %s attribute at %L",
+ gfc_code2string (flavors, attr->flavor),
+ gfc_code2string (flavors, f), where);
return FAILURE;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Ping: [patch, fortran] PR24633, improve diagnostic message
2007-04-30 12:15 [patch, fortran] PR24633, improve diagnostic message Daniel Franke
@ 2007-05-18 12:20 ` Daniel Franke
2007-05-18 13:15 ` François-Xavier Coudert
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Franke @ 2007-05-18 12:20 UTC (permalink / raw)
To: fortran; +Cc: gcc-patches
http://gcc.gnu.org/ml/gcc-patches/2007-04/msg02018.html
> 2007-04-30 Daniel Franke <franke.daniel@gmail.com>
> * symbol.c (gfc_add_flavor): Add the NAME to error message if
> available.
Ping?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Ping: [patch, fortran] PR24633, improve diagnostic message
2007-05-18 12:20 ` Ping: " Daniel Franke
@ 2007-05-18 13:15 ` François-Xavier Coudert
0 siblings, 0 replies; 3+ messages in thread
From: François-Xavier Coudert @ 2007-05-18 13:15 UTC (permalink / raw)
To: Daniel Franke; +Cc: fortran, gcc-patches
>> 2007-04-30 Daniel Franke <franke.daniel@gmail.com>
>> * symbol.c (gfc_add_flavor): Add the NAME to error message if
>> available.
OK for mainline (and sorry that it somehow did not make it into my
to-review list).
To answer your question in the original patch submission, this kind of
patch (diagnostics) is not suitable for 4.2 backport. Unless there is
a Utterly Strong and Specific Reason (with all capitals) that you want
to raise ;-)
FX
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-05-18 13:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-30 12:15 [patch, fortran] PR24633, improve diagnostic message Daniel Franke
2007-05-18 12:20 ` Ping: " Daniel Franke
2007-05-18 13:15 ` François-Xavier Coudert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).