Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Mar 2002 20:20:20 -0500
From:      Brian T.Schellenberger <bts@babbleon.org>
To:        Erik Trulsson <ertr1013@student.uu.se>, Ian <freebsd@damnhippie.dyndns.org>
Cc:        freebsd-hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: A few questions about a few includes
Message-ID:  <20020304012020.A1681BA05@i8k.babbleon.org>
In-Reply-To: <20020303180029.GA56041@student.uu.se>
References:  <XFMail.20020303091938.conrads@cox.net> <B8A7AB05.AAE6%freebsd@damnhippie.dyndns.org> <20020303180029.GA56041@student.uu.se>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 03 March 2002 01:00 pm, Erik Trulsson wrote:
> On Sun, Mar 03, 2002 at 10:27:17AM -0700, Ian wrote:
> > > In <sys/proc.h>:
> > >
> > > /*
> > > * pargs, used to hold a copy of the command line, if it had a sane
> > > * length
> > > */
> > > struct  pargs {
> > > u_int   ar_ref;         /* Reference count */
> > > u_int   ar_length;      /* Length */
> > > u_char  ar_args[0];     /* Arguments */
> > > };
>
> It might be worth mentioning that this trick is not actually allowed
> according to the C standard and in principle invokes undefined
> behaviour. OTOH, AFAIK the trick does work on all existing compilers,
> so while it is not standard-conforming it is quite portable.

I can't even imagine how one *would* write a compiler where this would 
fail--does anybody know the putative risk that led ANSI to "ban" this (IMHO) 
perfectly-reasonable bahvior?

-- 
Brian T. Schellenberger . . . . . . .   bts@wnt.sas.com (work)
Brian, the man from Babble-On . . . .   bts@babbleon.org (personal)
                                ME -->  http://www.babbleon.org
http://www.eff.org   <-- GOOD GUYS -->  http://www.programming-freedom.org 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020304012020.A1681BA05>