public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] AFS compile breakage in 2.5.43
@ 2002-10-16 23:03 Matt Reppert
  2002-10-16 23:16 ` David S. Miller
  2002-10-17  0:04 ` Chris Wright
  0 siblings, 2 replies; 6+ messages in thread
From: Matt Reppert @ 2002-10-16 23:03 UTC (permalink / raw)
  To: dhowells; +Cc: linux-kernel

Is this valid? gcc-2.95.3 doesn't like it at all.
[fs/afs/dir.c line 65]

typedef union afs_dirent {
        struct {
                u8      valid;
                u8      unused[1];
                u16     hash_next;
                u32     vnode;
                u32     unique;
                u8      name[16];
                u8      overflow[4];    /* if any char of the name (inc NUL) reaches here, consume
                                         * the next dirent too */
        };
        u8      extended_name[32];
} afs_dirent_t;

This breaks compile of AFS due to members of the unnamed struct being
used as members of afs_dirent_t objects:
fs/afs/dir.c:75: warning: unnamed struct/union that defines no instances
fs/afs/dir.c: In function `afs_dir_iterate_block':
fs/afs/dir.c:261: union has no member named `name'
fs/afs/dir.c:293: union has no member named `name'
fs/afs/dir.c:296: union has no member named `vnode'
fs/afs/dir.c:296: union has no member named `vnode'
fs/afs/dir.c:296: union has no member named `vnode'
fs/afs/dir.c:297: union has no member named `unique'

The following makes it compile.

--- linux-2.5.43-orig/fs/afs/dir	2002-10-16 17:54:04 -0500
+++ linux-2.5.43/fs/afs/dir.c	2002-10-16 17:55:07 -0500
@@ -72,7 +72,7 @@
 		u8	name[16];
 		u8	overflow[4];	/* if any char of the name (inc NUL) reaches here, consume
 					 * the next dirent too */
-	};
+	} ent;
 	u8	extended_name[32];
 } afs_dirent_t;
 
@@ -258,7 +258,7 @@
 
 		/* got a valid entry */
 		dire = &block->dirents[offset];
-		nlen = strnlen(dire->name,sizeof(*block) - offset*sizeof(afs_dirent_t));
+		nlen = strnlen(dire->ent.name,sizeof(*block) - offset*sizeof(afs_dirent_t));
 
 		_debug("ENT[%u.%u]: %s %u \"%.*s\"\n",
 		       blkoff/sizeof(afs_dir_block_t),offset,
@@ -290,11 +290,11 @@
 
 		/* found the next entry */
 		ret = filldir(cookie,
-			      dire->name,
+			      dire->ent.name,
 			      nlen,
 			      blkoff + offset * sizeof(afs_dirent_t),
-			      ntohl(dire->vnode),
-			      filldir==afs_dir_lookup_filldir ? dire->unique : DT_UNKNOWN);
+			      ntohl(dire->ent.vnode),
+			      filldir==afs_dir_lookup_filldir ? dire->ent.unique : DT_UNKNOWN);
 		if (ret<0) {
 			_leave(" = 0 [full]");
 			return 0;


Matt

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

end of thread, other threads:[~2002-10-17  7:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-16 23:03 [PATCH] AFS compile breakage in 2.5.43 Matt Reppert
2002-10-16 23:16 ` David S. Miller
2002-10-16 23:32   ` Matt Reppert
2002-10-17  0:04 ` Chris Wright
2002-10-17  7:34   ` David Howells
2002-10-17  7:41     ` Chris Wright

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