This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Do all arrays have to have a pad byte after them?
At 08:54 -0500 11/14/98, Nathan Sidwell wrote:
* Hyman Rosen wrote:
* >
* > Dave Brolley writes:
* > > While comparing the pointers one past the end is defined, dereferencing
* > > them is not. There is no need for a padding byte to actually be
allocated
* > > in memory. Even so, I would expect the test to print "failed" when
* > > compiled with most compilers.
* >
* > I repeat the quote from the standard, section 5.10 -
* >
* > Two pointers of the same type compare equal if and only if they are
* > both null, both point to the same object or function, or both point
* > one past the end of the same array.
* Your analysis assumes that a pointer cannot simultaneously point to one
* past the end of one array and the beginning of another array. I don't
* believe the standard prohibits that.
*
* nathan
* --
Ahh,... what do you think "if and only if" means....
The standard is quite clear (and IMHO "broken") about
what it's saying here.....
-- Al Lehotsky
------------------------------------------------------------------------
Quality Software Management
http://www.tiac.net/users/lehotsky
lehotsky@tiac.net
(978)287-0435 Voice
(978)287-0436 Fax/Data
Software Process Improvement and Management Consulting
Language Design and Compiler Implementation