This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR19352: proposed patch


This is a first patch for me so would appreciate suggestions.

Propose changing the error type for recursive io calls to runtime_error
rather than internal_error.  Change the error message to be clearer to
understand.  Fixes a typo in a comment.

I picked something simple since I am very new at this. I was not sure what to do for a test case. But I tested it with the sample program in the PR.

Let me know what you think and if OK can someone commit.

Bootstrapped and tested.

Attached diff

Jerry

Index: libgfortran/ChangeLog
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/ChangeLog,v
retrieving revision 1.164
diff -c -p -3 -r1.164 ChangeLog
*** libgfortran/ChangeLog       26 Feb 2005 18:33:08 -0000      1.164
--- libgfortran/ChangeLog       28 Feb 2005 05:34:05 -0000
***************
*** 1,3 ****
--- 1,10 ----
+ 2005-02-27  Jerry DeLisle <jvdelisle@verizon.net>
+
+        PR libgfortran/19352
+        * io/lock.c (library_start): Change recursive error
+        message type to runtime_error and clarify error message.
+        Fix typo in comment.
+
  2005-02-25  Peter O'Gorman  <peter@pogman.com>
              Toon Moene  <toon@moene.indiv.nluug.nl>

Index: libgfortran/io/lock.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/lock.c,v
retrieving revision 1.5
diff -c -p -3 -r1.5 lock.c
*** libgfortran/io/lock.c       12 Jan 2005 21:27:31 -0000      1.5
--- libgfortran/io/lock.c       28 Feb 2005 05:34:05 -0000
*************** namelist_info *ionml = 0;
*** 40,52 ****
  global_t g = { };


! /* library_start()-- Called with a library call is entered.  */

  void
  library_start (void)
  {
    if (g.in_library)
!     internal_error ("Recursive library calls not allowed");

    /* The in_library flag indicates whether we're currently processing a
       library call.  Some calls leave immediately, but READ and WRITE
--- 40,52 ----
  global_t g = { };


! /* library_start()-- Called when a library call is entered.  */

  void
  library_start (void)
  {
    if (g.in_library)
!     runtime_error ("Calling I/O from a function within an I/O list is not allowed.");

    /* The in_library flag indicates whether we're currently processing a
       library call.  Some calls leave immediately, but READ and WRITE

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]