Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!mit-eddie!genrad!panda!teddy!jpn From: jpn@teddy.UUCP Newsgroups: comp.arch Subject: Re: Aliasing, etc. in C (available no. of registers) Message-ID: <3720@teddy.UUCP> Date: Wed, 28-Jan-87 16:50:33 EST Article-I.D.: teddy.3720 Posted: Wed Jan 28 16:50:33 1987 Date-Received: Fri, 30-Jan-87 00:44:54 EST References: <7803@decwrl.DEC.COM> Reply-To: jpn@teddy.UUCP (John P. Nelson) Organization: GenRad, Inc., Concord, Mass. Lines: 20 >Oh? If this is aberrant coding, you might want to look at your >varargs.h file whose operation relies on these assumptions; and this is >in the ANSI proposal. Sigh.... Varargs is DEFINED as being machine-dependent - in other words, those varargs macros/functions may have to be rewritten for every machine - it is up to the system providers to provide definitions that work for a SINGLE machine: the one that is being compiled for. Any user code that does this is not portable. >>> int a,b, *ptr; >>> >>> ptr = &a; >>> ptr++; >>> /* ptr now points to b */ Any program that is expected to work on more than one machine MUST NOT make assumptions about memory layout. This is the reason why varargs exists: So that 100's of programs do not have to make such assumptions! Sure, this is legal C, but the trailing comment is NOT NECESSARILY TRUE!