Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc/sparc workaround a problem -Warray-bounds tri...



details:   https://anonhg.NetBSD.org/src/rev/33407fe01c8e
branches:  trunk
changeset: 829582:33407fe01c8e
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Feb 06 09:22:57 2018 +0000

description:
workaround a problem -Warray-bounds triggers but isn't a problem
in practise, as described from this old commment:

/*
 * Set up pm_regmap for kernel to point NUREG *below* the beginning
 * of kernel regmap storage. Since the kernel only uses regions
 * above NUREG, we save storage space and can index kernel and
 * user regions in the same way.
 */

diffstat:

 sys/arch/sparc/sparc/pmap.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 71249550416a -r 33407fe01c8e sys/arch/sparc/sparc/pmap.c
--- a/sys/arch/sparc/sparc/pmap.c       Tue Feb 06 09:21:07 2018 +0000
+++ b/sys/arch/sparc/sparc/pmap.c       Tue Feb 06 09:22:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.362 2018/01/16 08:23:17 mrg Exp $ */
+/*     $NetBSD: pmap.c,v 1.363 2018/02/06 09:22:57 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.362 2018/01/16 08:23:17 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.363 2018/02/06 09:22:57 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -3214,7 +3214,10 @@
         * above NUREG, we save storage space and can index kernel and
         * user regions in the same way.
         */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
        kernel_pmap_store.pm_regmap = kernel_regmap_store - NUREG;
+#pragma GCC diagnostic pop
        for (i = NKREG; --i >= 0;) {
 #if defined(SUN4_MMU3L)
                kernel_regmap_store[i].rg_smeg = reginval;
@@ -3592,7 +3595,10 @@
         * above NUREG, we save storage space and can index kernel and
         * user regions in the same way.
         */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
        kernel_pmap_store.pm_regmap = kernel_regmap_store - NUREG;
+#pragma GCC diagnostic pop
        memset(kernel_regmap_store, 0, NKREG * sizeof(struct regmap));
        memset(kernel_segmap_store, 0, NKREG * NSEGRG * sizeof(struct segmap));
        for (i = NKREG; --i >= 0;) {



Home | Main Index | Thread Index | Old Index