public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34997]  New: Common vendor extension: Support symbol names containing $
@ 2008-01-28 15:22 burnus at gcc dot gnu dot org
  2008-01-28 17:27 ` [Bug fortran/34997] " aldot at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-28 15:22 UTC (permalink / raw)
  To: gcc-bugs

This seems to be a common vendor extension. Example:

      REAL*4 PLT$C_HOUSTPIX
      INTEGER PLT$C_COMMAND
      PARAMETER (PLT$B_OPC=0)
      common /abc$def/ PLT$C_HOUSTPIX, PLT$C_COMMAND
      end

This compiles using NAG f95 (with the warning "Extension: Name contains $
character") and with ifort, sunf95, openf95. With "-stand f95" also ifort warns
("Invalid use of $ character in identifier"). While gfortran rejects it
completely (syntax error).


-- 
           Summary: Common vendor extension: Support symbol names containing
                    $
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34997


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

* [Bug fortran/34997] Common vendor extension: Support symbol names containing $
  2008-01-28 15:22 [Bug fortran/34997] New: Common vendor extension: Support symbol names containing $ burnus at gcc dot gnu dot org
@ 2008-01-28 17:27 ` aldot at gcc dot gnu dot org
  2008-01-28 17:40 ` burnus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: aldot at gcc dot gnu dot org @ 2008-01-28 17:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from aldot at gcc dot gnu dot org  2008-01-28 16:34 -------
See also
http://gcc.gnu.org/ml/fortran/2007-01/msg00060.html

specifically the "PS ... -fdollar-ok" there.


-- 

aldot at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldot at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34997


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

* [Bug fortran/34997] Common vendor extension: Support symbol names containing $
  2008-01-28 15:22 [Bug fortran/34997] New: Common vendor extension: Support symbol names containing $ burnus at gcc dot gnu dot org
  2008-01-28 17:27 ` [Bug fortran/34997] " aldot at gcc dot gnu dot org
@ 2008-01-28 17:40 ` burnus at gcc dot gnu dot org
  2008-01-28 18:00 ` dominiq at lps dot ens dot fr
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-28 17:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2008-01-28 17:09 -------
Thanks for the pointer. I think we need in general to update some of the error
message to point to the relevant option. (For the most common, namely
"-fno-range-check" we do so already; for -std=f* related ones we partially do
("Fortran 2003", "Extension:") though I think not consistently -std=legacy.)

For $ I think the following should be OK for 4.4.0.

Index: match.c
===================================================================
--- match.c     (Revision 131899)
+++ match.c     (Arbeitskopie)
@@ -519,6 +519,13 @@ gfc_match_name (char *buffer)
     }
   while (ISALNUM (c) || c == '_' || (gfc_option.flag_dollar_ok && c == '$'));

+  if (c == '$' && !gfc_option.flag_dollar_ok)
+    {
+      gfc_error ("Invalid '$' character at %C. Use -fdollar-ok to accept it");
+      return MATCH_ERROR;
+    }
+
+
   buffer[i] = '\0';
   gfc_current_locus = old_loc;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34997


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

* [Bug fortran/34997] Common vendor extension: Support symbol names containing $
  2008-01-28 15:22 [Bug fortran/34997] New: Common vendor extension: Support symbol names containing $ burnus at gcc dot gnu dot org
  2008-01-28 17:27 ` [Bug fortran/34997] " aldot at gcc dot gnu dot org
  2008-01-28 17:40 ` burnus at gcc dot gnu dot org
@ 2008-01-28 18:00 ` dominiq at lps dot ens dot fr
  2008-01-28 18:12 ` aldot at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-01-28 18:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dominiq at lps dot ens dot fr  2008-01-28 17:21 -------
I always wonder if a hard error is really necessary for such cases? would not a
warning be sufficient? I think there is a flag to change warnings to errors if
necessary (-Werror?).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34997


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

* [Bug fortran/34997] Common vendor extension: Support symbol names containing $
  2008-01-28 15:22 [Bug fortran/34997] New: Common vendor extension: Support symbol names containing $ burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-01-28 18:00 ` dominiq at lps dot ens dot fr
@ 2008-01-28 18:12 ` aldot at gcc dot gnu dot org
  2008-01-29 10:57 ` [Bug fortran/34997] Mention -fdollar-ok option in error message for " fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: aldot at gcc dot gnu dot org @ 2008-01-28 18:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from aldot at gcc dot gnu dot org  2008-01-28 17:30 -------
Invalid code should be diagnosed. Since this particular case even has a flag to
accept the invalid code, the hard error is fine IMHO.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34997


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

* [Bug fortran/34997] Mention -fdollar-ok option in error message for symbol names containing $
  2008-01-28 15:22 [Bug fortran/34997] New: Common vendor extension: Support symbol names containing $ burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-01-28 18:12 ` aldot at gcc dot gnu dot org
@ 2008-01-29 10:57 ` fxcoudert at gcc dot gnu dot org
  2008-02-20 18:22 ` burnus at gcc dot gnu dot org
  2008-02-20 18:29 ` burnus at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-01-29 10:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic, patch
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-29 10:19:46
               date|                            |
            Summary|Common vendor extension:    |Mention -fdollar-ok option
                   |Support symbol names        |in error message for symbol
                   |containing $                |names containing $
   Target Milestone|---                         |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34997


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

* [Bug fortran/34997] Mention -fdollar-ok option in error message for symbol names containing $
  2008-01-28 15:22 [Bug fortran/34997] New: Common vendor extension: Support symbol names containing $ burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-01-29 10:57 ` [Bug fortran/34997] Mention -fdollar-ok option in error message for " fxcoudert at gcc dot gnu dot org
@ 2008-02-20 18:22 ` burnus at gcc dot gnu dot org
  2008-02-20 18:29 ` burnus at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-02-20 18:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from burnus at gcc dot gnu dot org  2008-02-20 18:22 -------
Subject: Bug 34997

Author: burnus
Date: Wed Feb 20 18:21:14 2008
New Revision: 132488

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132488
Log:
2008-02-20  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34997
        * match.c (gfc_match_name): Improve error message for '$'.

2008-02-20  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34997
        * gfortran.dg/dollar_sym_1.f90: New.
        * gfortran.dg/dollar_sym_2.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/dollar_sym_1.f90
    trunk/gcc/testsuite/gfortran.dg/dollar_sym_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/match.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34997


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

* [Bug fortran/34997] Mention -fdollar-ok option in error message for symbol names containing $
  2008-01-28 15:22 [Bug fortran/34997] New: Common vendor extension: Support symbol names containing $ burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-02-20 18:22 ` burnus at gcc dot gnu dot org
@ 2008-02-20 18:29 ` burnus at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-02-20 18:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from burnus at gcc dot gnu dot org  2008-02-20 18:28 -------
FIXED on the trunk (4.4.0)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34997


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

end of thread, other threads:[~2008-02-20 18:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-28 15:22 [Bug fortran/34997] New: Common vendor extension: Support symbol names containing $ burnus at gcc dot gnu dot org
2008-01-28 17:27 ` [Bug fortran/34997] " aldot at gcc dot gnu dot org
2008-01-28 17:40 ` burnus at gcc dot gnu dot org
2008-01-28 18:00 ` dominiq at lps dot ens dot fr
2008-01-28 18:12 ` aldot at gcc dot gnu dot org
2008-01-29 10:57 ` [Bug fortran/34997] Mention -fdollar-ok option in error message for " fxcoudert at gcc dot gnu dot org
2008-02-20 18:22 ` burnus at gcc dot gnu dot org
2008-02-20 18:29 ` burnus at gcc dot gnu dot 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).