🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #560

VMS fix for cccp.c

#560
From: angel li
Date: Thu, 31 Aug 1989 18:38
85 lines
2650 bytes
The following patch fixes two problems:

	* On VMS, argv[0] has the absolute path of the program.  I removed
	  the directory spec and extension so when errors are printed, they fit
	  on a single line.

	* In pfatal_with_name, change the exit code from a generic failure 
	  code to the exact reason.

The third patch is something that I will announce sometime soon...


Angel Li
University of Miami/RSMAS Remote Sensing Group

Internet: angel@flipper.miami.edu			UUCP: ncar!umigw!angel



*** cccp.c-orig	Thu Aug 31 17:46:39 1989
--- cccp.c	Thu Aug 31 18:16:34 1989
***************
*** 272,280 ****
      { &cplusplus_include_defaults[2], GCC_INCLUDE_DIR },
      { 0, "/usr/include" }
  #else
!     { &cplusplus_include_defaults[1], "GNU_CC_INCLUDE:" },
      /* VAX-11 C includes */
!     { &cplusplus_include_defaults[2], "SYS$SYSROOT:[SYSLIB.]" },
      { 0, "" },	/* This makes normal VMS filespecs work OK */
  #endif /* VMS */
    };
--- 272,281 ----
      { &cplusplus_include_defaults[2], GCC_INCLUDE_DIR },
      { 0, "/usr/include" }
  #else
!     { &cplusplus_include_defaults[1], "GNU_GXX_INCLUDE:" },
!     { &include_defaults[2], "GNU_CC_INCLUDE:" },       /* GNU includes */
      /* VAX-11 C includes */
!     { &cplusplus_include_defaults[3], "SYS$SYSROOT:[SYSLIB.]" },
      { 0, "" },	/* This makes normal VMS filespecs work OK */
  #endif /* VMS */
    };
***************
*** 539,544 ****
--- 540,563 ----
    /* Target-name to write with the dependency information.  */
    char *deps_target = 0;
  
+ #ifdef VMS
+   {
+     /*
+        Remove the directory information from argv[0]:
+        Error messages might fit on one line now.
+     */
+     char		*s;
+     char		*strrchr();
+ 
+     if (!(s = strrchr(argv[0], ']')))
+       s = strrchr(argv[0], ':');
+     if (s)
+       strcpy(argv[0], s+1);
+     if (s = strrchr(argv[0], '.'))
+       *s = '\0';
+   }
+ #endif
+ 
  #ifdef RLIMIT_STACK
    /* Get rid of any avoidable limit on stack size.  */
    {
***************
*** 5307,5313 ****
--- 5326,5336 ----
       char *name;
  {
    perror_with_name (name);
+ #ifdef VMS
+   exit (vaxc$errno);
+ #else
    exit (FATAL_EXIT_CODE);
+ #endif
  }
  
  
Technical Details
Message-ID: <8908311838.AA03117@flipper.Miami.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!FLIPPER.MIAMI.EDU!angel

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!FLIPPER.MIAMI.EDU!angel
From: angel@FLIPPER.MIAMI.EDU (angel li)
Newsgroups: gnu.gcc.bug
Subject: VMS fix for cccp.c
Message-ID: <8908311838.AA03117@flipper.Miami.EDU>
Date: 31 Aug 89 18:38:01 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 85