rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Scott Merrilees <Sm@cerberus.bhpese.oz.au>
To: rc@hawkwind.utcs.toronto.edu
Subject: Re: rc under hp-ux
Date: Wed, 13 Jan 1993 01:06:39 -0500	[thread overview]
Message-ID: <199301130606.AA17370@cerberus.bhpese.oz.au> (raw)


>From:  	Scott Merrilees <Sm@cerberus.bhpese.oz.au>
>We have aquired a hp 9000/817 running hp-ux A.09.00, and I started
>my usual porting sequence, compile rc.  Unfortunately, it doesn't
>work.  More specifically stdargs/varargs seems to be playing up.
>Compiling -O causes the compiler to barf on print.c, compiling -g
>completes, but then execution results in core dumps.

It looks like there is a bug in how the hp compiler handles
stdarg/varargs stuff.   va_start() results in a call to
__builtin_va_start(), which I assume is intercepted by the compiler as
a special function, & it tries to do some magic.  This doesn't seem to
work if the first argument is a structure element reference using . or
->.

The work around was to replace the structure element references with
simple variables.

I have raised this matter with hp support, so hopefully the compiler
will get fixed.

In the interim, if anyone has this problem with a hp, they might like
to try the following patch to print.c.

Sm
--
*** print.c.orig	Mon Apr  6 14:22:28 1992
--- print.c	Wed Jan 13 16:44:05 1993
***************
*** 272,278 ****
  	int n = -format->flushed;
  	va_list saveargs = format->args;
  
! 	va_start(format->args, fmt);
  	n += printfmt(format, fmt);
  	va_end(format->args);
  	format->args = saveargs;
--- 272,278 ----
  	int n = -format->flushed;
  	va_list saveargs = format->args;
  
! 	{ va_list ap; va_start(ap, fmt); format->args = ap; }
  	n += printfmt(format, fmt);
  	va_end(format->args);
  	format->args = saveargs;
***************
*** 300,306 ****
  	format.flushed	= 0;
  	format.u.n	= fd;
  
! 	va_start(format.args, fmt);
  	printfmt(&format, fmt);
  	va_end(format.args);
  
--- 300,306 ----
  	format.flushed	= 0;
  	format.u.n	= fd;
  
! 	{ va_list ap; va_start(ap, fmt); format.args = ap; }
  	printfmt(&format, fmt);
  	va_end(format.args);
  
***************
*** 341,347 ****
  	Format format;
  	char *result;
  	format.u.n = 1;
! 	va_start(format.args, fmt);
  	result = memprint(&format, fmt, ealloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
  	va_end(format.args);
  	return result;
--- 341,347 ----
  	Format format;
  	char *result;
  	format.u.n = 1;
! 	{ va_list ap; va_start(ap, fmt); format.args = ap; }
  	result = memprint(&format, fmt, ealloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
  	va_end(format.args);
  	return result;
***************
*** 351,357 ****
  	Format format;
  	char *result;
  	format.u.n = 0;
! 	va_start(format.args, fmt);
  	result = memprint(&format, fmt, nalloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
  	va_end(format.args);
  	return result;
--- 351,357 ----
  	Format format;
  	char *result;
  	format.u.n = 0;
! 	{ va_list ap; va_start(ap, fmt); format.args = ap; }
  	result = memprint(&format, fmt, nalloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
  	va_end(format.args);
  	return result;


             reply	other threads:[~1993-01-13  6:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-01-13  6:06 Scott Merrilees [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-01-12  7:12 Scott Merrilees
1993-01-12 21:57 ` David J. Fiander
1993-01-13  0:27   ` Scott Merrilees

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199301130606.AA17370@cerberus.bhpese.oz.au \
    --to=sm@cerberus.bhpese.oz.au \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).