Module Name:    src
Committed By:   christos
Date:           Tue Jun  2 21:10:07 UTC 2020

Modified Files:
        src/usr.bin/xlint/lint1: decl.c err.c tree.c

Log Message:
Fix return of alignof()


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.87 -r1.88 src/usr.bin/xlint/lint1/tree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.70 src/usr.bin/xlint/lint1/decl.c:1.71
--- src/usr.bin/xlint/lint1/decl.c:1.70	Mon Mar  4 12:45:16 2019
+++ src/usr.bin/xlint/lint1/decl.c	Tue Jun  2 17:10:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.70 2019/03/04 17:45:16 christos Exp $ */
+/* $NetBSD: decl.c,v 1.71 2020/06/02 21:10:07 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.70 2019/03/04 17:45:16 christos Exp $");
+__RCSID("$NetBSD: decl.c,v 1.71 2020/06/02 21:10:07 christos Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1153,7 +1153,7 @@ decl1str(sym_t *dsym)
 		}
 		if ((len = tp->t_flen) < 0 || len > (ssize_t)size(t)) {
 			/* illegal bit-field size */
-			error(36);
+			error(36, len);
 			tp->t_flen = size(t);
 		} else if (len == 0 && dsym->s_name != unnamed) {
 			/* zero size bit-field */

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.53 src/usr.bin/xlint/lint1/err.c:1.54
--- src/usr.bin/xlint/lint1/err.c:1.53	Fri Sep  7 11:16:15 2018
+++ src/usr.bin/xlint/lint1/err.c	Tue Jun  2 17:10:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.53 2018/09/07 15:16:15 christos Exp $	*/
+/*	$NetBSD: err.c,v 1.54 2020/06/02 21:10:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.53 2018/09/07 15:16:15 christos Exp $");
+__RCSID("$NetBSD: err.c,v 1.54 2020/06/02 21:10:07 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -95,7 +95,7 @@ const	char *msgs[] = {
 	"duplicate member name: %s",				      /* 33 */
 	"nonportable bit-field type",				      /* 34 */
 	"illegal bit-field type",				      /* 35 */
-	"illegal bit-field size",				      /* 36 */
+	"illegal bit-field size: %d",				      /* 36 */
 	"zero size bit-field",					      /* 37 */
 	"function illegal in structure or union",		      /* 38 */
 	"zero sized array in struct is a C99 extension: %s",	      /* 39 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.87 src/usr.bin/xlint/lint1/tree.c:1.88
--- src/usr.bin/xlint/lint1/tree.c:1.87	Fri Jul 12 19:32:45 2019
+++ src/usr.bin/xlint/lint1/tree.c	Tue Jun  2 17:10:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.87 2019/07/12 23:32:45 christos Exp $	*/
+/*	$NetBSD: tree.c,v 1.88 2020/06/02 21:10:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.87 2019/07/12 23:32:45 christos Exp $");
+__RCSID("$NetBSD: tree.c,v 1.88 2020/06/02 21:10:07 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -3152,7 +3152,7 @@ bldalof(type_t *tp)
 	st = UINT;
 #endif
 
-	return getinode(st, (int64_t)getbound(tp));
+	return getinode(st, (int64_t)getbound(tp) / CHAR_BIT);
 }
 
 /*

Reply via email to