public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/80012] FIXME in diagnostic "%s procedure at %L is already declared as %s procedure" from symbol.c
       [not found] <bug-80012-4@http.gcc.gnu.org/bugzilla/>
@ 2024-03-17 11:45 ` anujmohite001 at gmail dot com
  2024-03-18 18:53 ` jvdelisle at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: anujmohite001 at gmail dot com @ 2024-03-17 11:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80012

Anuj Mohite <anujmohite001 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anujmohite001 at gmail dot com

--- Comment #4 from Anuj Mohite <anujmohite001 at gmail dot com> ---
can we split the original error message into two separate calls to gfc_error()
fuction. file: fortran/symbol.cc

Before changes:

gfc_error ("%s procedure at %L is already declared as %s "
           "procedure. \nF2008: A pointer function assignment "
           "is ambiguous if it is the first executable statement "
           "after the specification block. Please add any other "
           "kind of executable statement before it. FIXME",

After changes:

// Main error message
gfc_error ("%s procedure at %L is already declared as %s procedure",
           gfc_code2string(procedures, t), where,
           gfc_code2string(procedures, attr->proc));

// Additional information for F2008 standard
gfc_error("A pointer function assignment is ambiguous if it is the first "
           "executable statement after the specification block. Please add "
           "any other kind of executable statement before it.");

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/80012] FIXME in diagnostic "%s procedure at %L is already declared as %s procedure" from symbol.c
       [not found] <bug-80012-4@http.gcc.gnu.org/bugzilla/>
  2024-03-17 11:45 ` [Bug fortran/80012] FIXME in diagnostic "%s procedure at %L is already declared as %s procedure" from symbol.c anujmohite001 at gmail dot com
@ 2024-03-18 18:53 ` jvdelisle at gcc dot gnu.org
  2024-03-18 18:57 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2024-03-18 18:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80012

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at gcc dot gnu.org

--- Comment #5 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
I have not looked at this in detail. Generally, you can do conditional errors
depending on what -std=fxxxx a user specifies at compile time. So theoretically
you can do two different errors depending on these options.

Also look in the codes for examples of 'notify' or 'notification' to see ways
to do these things.

Another way is to build an error message with snprintf for example and use that
string in the error message.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/80012] FIXME in diagnostic "%s procedure at %L is already declared as %s procedure" from symbol.c
       [not found] <bug-80012-4@http.gcc.gnu.org/bugzilla/>
  2024-03-17 11:45 ` [Bug fortran/80012] FIXME in diagnostic "%s procedure at %L is already declared as %s procedure" from symbol.c anujmohite001 at gmail dot com
  2024-03-18 18:53 ` jvdelisle at gcc dot gnu.org
@ 2024-03-18 18:57 ` jakub at gcc dot gnu.org
  2024-03-18 18:58 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-18 18:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80012

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
At least in the middle-end or C/C++ FEs such diagnostics is done with
error{,_at}/warning{,_at} etc. followed by inform, for warning inform only
called if warning* returned true, and wrapped with auto_diagnostic_group d;
because it is really just one error (or warning) with extra explanation, not
two separate errors.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/80012] FIXME in diagnostic "%s procedure at %L is already declared as %s procedure" from symbol.c
       [not found] <bug-80012-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2024-03-18 18:57 ` jakub at gcc dot gnu.org
@ 2024-03-18 18:58 ` jakub at gcc dot gnu.org
  2024-03-18 21:02 ` roland.illig at gmx dot de
  2024-03-18 21:44 ` anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-18 18:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80012

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jerry DeLisle from comment #5)
> Another way is to build an error message with snprintf for example and use
> that string in the error message.

That is translation unfriendly.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/80012] FIXME in diagnostic "%s procedure at %L is already declared as %s procedure" from symbol.c
       [not found] <bug-80012-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2024-03-18 18:58 ` jakub at gcc dot gnu.org
@ 2024-03-18 21:02 ` roland.illig at gmx dot de
  2024-03-18 21:44 ` anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: roland.illig at gmx dot de @ 2024-03-18 21:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80012

--- Comment #8 from Roland Illig <roland.illig at gmx dot de> ---
(In reply to Jakub Jelinek from comment #7)
> (In reply to Jerry DeLisle from comment #5)
> > Another way is to build an error message with snprintf for example and use
> > that string in the error message.
> 
> That is translation unfriendly.

And the German translator (me) is particularly picky about these topics, so
whenever you assemble diagnostics using snprintf, you'll get a new bug report
from me; see #114364 for an example.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/80012] FIXME in diagnostic "%s procedure at %L is already declared as %s procedure" from symbol.c
       [not found] <bug-80012-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2024-03-18 21:02 ` roland.illig at gmx dot de
@ 2024-03-18 21:44 ` anlauf at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2024-03-18 21:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80012

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #9 from anlauf at gcc dot gnu.org ---
This is all quite confusing.

First, who is the addressee of the FIXME?  gfortran developers or users?

And can someone explain this special distinguishment is made (F2008 or not)?

Other compilers tested seem to be "uncomfortable" with Dominique's example
in comment#2, as they are unable to recognize that two() is not a
statement function.  Even with an added statement in front.

Can anyone point to the exact formulation in the standard that clarifies
the situation?

The first part of the error message seems to be emitted in any case.
Thus, the second part appears to be aiming to help the user to fix
his/her code.  But is it the right recommendation?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-18 21:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-80012-4@http.gcc.gnu.org/bugzilla/>
2024-03-17 11:45 ` [Bug fortran/80012] FIXME in diagnostic "%s procedure at %L is already declared as %s procedure" from symbol.c anujmohite001 at gmail dot com
2024-03-18 18:53 ` jvdelisle at gcc dot gnu.org
2024-03-18 18:57 ` jakub at gcc dot gnu.org
2024-03-18 18:58 ` jakub at gcc dot gnu.org
2024-03-18 21:02 ` roland.illig at gmx dot de
2024-03-18 21:44 ` anlauf at gcc dot gnu.org

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).