linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jason Kim <jwk2@eecs.lehigh.edu>
To: Franz.Sirl-kernel@lauterbach.com,
	linuxppc-dev@lists.linuxppc.org, gcc-patches@gcc.gnu.org
Subject: Re: patch for problem with va-ppc.h included with egcs and gcc-2.95.2
Date: Tue, 30 Nov 1999 01:00:33 -0500	[thread overview]
Message-ID: <38436801.81D6CE60@eecs.lehigh.edu> (raw)


Agreed, ssh2 code isn't necessarily the cleanest in the world, but then again
the varargs situation in PPC world is a bit peculiar.


typedef struct A {
  char foo;
  char *bar;
} B[1], C[1];

typedef C D;


void tst(D d1)
{
  D d2;
  d1 = d2; // this is legal
  // d2 = d1; // this is not
}

declaring arrays of fixed size seems a bit strange for a type which will be used
by user code, since it makes d1 and d2 be different types sometimes. Not to
mention, having struct _va_list_tag  AS va_list seem to fix the problems neatly.

Is there a technical reason for keeping va_list as an array of 1 element? 
(instead of just a single element??)

-jason.


Franz.Sirl-kernel@lauterbach.com wrote:
> Am Mon, 29 Nov 1999 schrieb Jason Kim:
> >There is a problem with va-ppc.h distributed with recent versions ofgcc (2.95
> >and onwards) as well as the older egcs 1.1 releases.
> >
> >va-ppc.h typedefs va_list as an array of 1 element of struct
> >_va_list_tag but this causes problems when va_lists (or pointers to
> >them!) are passed as arguments to functions:
> >
> >e.g.
> >
> >void foo(va_list va1)
> >{
> >va_list va2;
> >va1 = va2;
> >}
> 
> The source is wrong, this code is simply non-portable. Use __va_copy(va1, va2)
> or some memcpy trickery to fix the source.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

             reply	other threads:[~1999-11-30  6:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-30  6:00 Jason Kim [this message]
1999-11-30 10:58 ` patch for problem with va-ppc.h included with egcs and gcc-2.95.2 Franz Sirl
1999-11-30 18:05   ` Jason Kim
1999-11-30 23:28   ` Jason Kim
1999-12-01 15:33     ` Franz Sirl
1999-12-01 19:18       ` Jason Kim
1999-12-01 19:41         ` Kevin Hendricks
1999-12-02  5:20           ` Jason Kim
1999-12-02  7:15             ` Richard Henderson
1999-12-02  7:27             ` Kevin Buettner
1999-12-02 16:15               ` Jason Kim
1999-12-01 19:43         ` David A. Gatwood
1999-12-02  2:04           ` Jason Kim
  -- strict thread matches above, loose matches on Subject: below --
1999-11-29 21:03 Jason Kim
1999-11-29 22:45 ` Franz Sirl

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=38436801.81D6CE60@eecs.lehigh.edu \
    --to=jwk2@eecs.lehigh.edu \
    --cc=Franz.Sirl-kernel@lauterbach.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /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).