public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Compatibility issue with 2.2.19pre7
@ 2001-01-10  0:37 Hubert Mantel
  2001-01-10  0:43 ` Alan Cox
  2001-01-10  6:54 ` Russell King
  0 siblings, 2 replies; 30+ messages in thread
From: Hubert Mantel @ 2001-01-10  0:37 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

Hi,

is this part of 2.2.19pre7 really a good idea? Even in 2.4.0 the size
field is still a short.
                                                                  -o)
    Hubert Mantel              Goodbye, dots...                   /\\
                                                                 _\_v

[-- Attachment #2: pre-patch-2.2.19-7 --]
[-- Type: text/plain, Size: 408 bytes --]

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/include/linux/nfs.h linux.19p7/include/linux/nfs.h
--- linux.vanilla/include/linux/nfs.h	Mon Dec 11 22:13:07 2000
+++ linux.19p7/include/linux/nfs.h	Wed Jan  3 00:58:38 2001
@@ -94,7 +94,7 @@
  */
 #define NFS_MAXFHSIZE		64
 struct nfs_fh {
-	unsigned short		size;
+	unsigned int		size;
 	unsigned char		data[NFS_MAXFHSIZE];
 };
 

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Compatibility issue with 2.2.19pre7
@ 2001-01-24 13:46 Jesse Pollard
  0 siblings, 0 replies; 30+ messages in thread
From: Jesse Pollard @ 2001-01-24 13:46 UTC (permalink / raw)
  To: andrea, Richard Henderson
  Cc: Russell King, Hubert Mantel, Linux Kernel Mailing List, Alan Cox

Andrea Arcangeli <andrea@suse.de>:
> On Tue, Jan 23, 2001 at 11:51:15PM -0800, Richard Henderson wrote:
> > On Thu, Jan 11, 2001 at 12:59:24AM +0100, Andrea Arcangeli wrote:
> > > What I said is that I can write this C code:
> > > 
> > > 	int x[2], * p = (int *) (((char *) &x)+1);
> > > 	main()
> > > 	{
> > > 		*p = 0;
> > > 	}
> > > 
> > > This is legal C code.
> > 
> > Err, no.  This is not "legal" by any stretch of the imagination.
> > This code has undefined behaviour.
> 
> I know this code has undefined behaviour at _runtime_. But I thought
> you were obliged to allow it to compile. That was my only point.
> 
> > We aren't even obliged to allow this to compile.
> 
> I'd love if you could forbid it to compile.

It would have to be implementation dependant/architecture dependant-
The only way to know is to realize that *p initializer value is invalid
is to know:

1. integer addresses MUST be aligned (say 4 or 8 byte boundaries)
2. the computation of (int *) (((char *) &x)+1) is a constant at
   compile time, and not link time (some linkers can do address offset
   calculations if "x" happens to be an external - ie. x +/- offset and
   offset is a constant)

Other systems would have to allow it to compile (and link). It still has
undefined behaviour, and is non-portable.

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2001-01-24 17:49 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-10  0:37 Compatibility issue with 2.2.19pre7 Hubert Mantel
2001-01-10  0:43 ` Alan Cox
2001-01-10  6:54 ` Russell King
2001-01-10 15:31   ` Andrea Arcangeli
2001-01-10 22:09     ` Russell King
2001-01-10 23:59       ` Andrea Arcangeli
2001-01-11  7:34         ` Russell King
2001-01-11 10:33           ` Andi Kleen
2001-01-11 10:36             ` Russell King
2001-01-11 12:10           ` Manfred
2001-01-11 12:10             ` Andi Kleen
2001-01-11 12:29               ` Manfred
2001-01-11 13:27                 ` Russell King
2001-01-24  7:51         ` Richard Henderson
2001-01-24  9:02           ` Andrea Arcangeli
2001-01-24  9:51             ` Richard Henderson
2001-01-24 12:21               ` Andrea Arcangeli
2001-01-24 17:49                 ` Richard Henderson
2001-01-24 10:09             ` Thomas Pornin
2001-01-11 15:28     ` Trond Myklebust
2001-01-11 16:19       ` Manfred Spraul
2001-01-11 17:44         ` Trond Myklebust
2001-01-11 18:22           ` Trond Myklebust
2001-01-11 18:27             ` Andrea Arcangeli
2001-01-11 18:30               ` Trond Myklebust
2001-01-11 18:43                 ` Andrea Arcangeli
2001-01-11 20:09                   ` Russell King
2001-01-11 20:39                   ` Trond Myklebust
2001-01-11 11:37   ` Trond Myklebust
  -- strict thread matches above, loose matches on Subject: below --
2001-01-24 13:46 Jesse Pollard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox