public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@cygnus.com>
To: Gigi Sullivan <sullivan@sikurezza.org>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Knowing the number of variable arguments.
Date: Mon, 29 May 2000 11:18:00 -0000	[thread overview]
Message-ID: <orr9al2pac.fsf@saci.lsd.ic.unicamp.br> (raw)
In-Reply-To: <20000529195259.C262@armageddon.libero.it>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

On May 29, 2000, Gigi Sullivan <sullivan@sikurezza.org> wrote:

>> On May 29, 2000, Gigi Sullivan <sullivan@sikurezza.org> wrote:

>> > 	This is bad, since I cannot know *when* the list is terminated

>> How about requiring a NULL terminator, as in exec()?

> 	Well, I would avoid using this solution (It's boring for what
> 	I'm doing to put *mandatory* a NULL at the end).

If there's no perfect solution, a boring one will have to do, right? :-)

> 	Nevertheless to say (well, as you know ;)) that this could be
> 	non-portable too (Am I right?) :

Nope.  If you pass a list of pointers, the last of which is NULL, then
you can certainly expect va_arg to work correctly on all platforms, as
long as you tell it each argument is the appropriate pointer type.

> 	Not all pass parameters on the stack (that could grows towards
> 	lower/upper address).

va_arg will take care of this for you.

> Could be this an addendum to the current gcc?

What kind of extension are you thinking of?

-- 
Alexandre Oliva    Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

  reply	other threads:[~2000-05-29 11:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-28 17:39 Gigi Sullivan
2000-05-28 18:18 ` Alexandre Oliva
2000-05-28 18:27   ` Gigi Sullivan
2000-05-29 11:18     ` Alexandre Oliva [this message]
2000-05-29 12:27       ` Mike Corbeil
2000-05-29 14:01         ` Gigi Sullivan
2000-05-29 14:23           ` Alexandre Oliva
2000-05-29 14:42             ` Gigi Sullivan

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=orr9al2pac.fsf@saci.lsd.ic.unicamp.br \
    --to=aoliva@cygnus.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=sullivan@sikurezza.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 read-only IMAP folder(s) and NNTP newsgroup(s).