Module Name: src Committed By: rin Date: Wed Sep 25 08:32:44 UTC 2024
Modified Files: src/sys/arch/atari/stand/tostools/libtos: Makefile sysinfo.c Log Message: atari/stand: Rework sysinfo.c v.s. GCC12 -Warray-bounds sysinfo.c is also used for bootxxx. Convert `-Wno-error=...` into `#pragma gcc diagnostic ...` to the source file, although this does not narrow down scope of hack. Fix atari build this time for sure ;) To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/atari/stand/tostools/libtos/Makefile cvs rdiff -u -r1.9 -r1.10 src/sys/arch/atari/stand/tostools/libtos/sysinfo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/atari/stand/tostools/libtos/Makefile diff -u src/sys/arch/atari/stand/tostools/libtos/Makefile:1.6 src/sys/arch/atari/stand/tostools/libtos/Makefile:1.7 --- src/sys/arch/atari/stand/tostools/libtos/Makefile:1.6 Tue Sep 24 11:13:41 2024 +++ src/sys/arch/atari/stand/tostools/libtos/Makefile Wed Sep 25 08:32:44 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.6 2024/09/24 11:13:41 rin Exp $ +# $NetBSD: Makefile,v 1.7 2024/09/25 08:32:44 rin Exp $ # LIB = libtos.a @@ -12,9 +12,3 @@ include ../Makefile.inc ${LIB}: ${OBJS} @${RM} ${LIB} ${AR} ${LIB} ${OBJS} - -.if ${HAVE_GCC:U0} >= 12 -# ADDR_* defined in tosdefs.h are in the 0-th page, even if 4KB page, -# i.e., [0, 0x1000). This causes -Warray-bounds for GCC12 and later. -COPTS.sysinfo.c+= -Wno-error=array-bounds -.endif Index: src/sys/arch/atari/stand/tostools/libtos/sysinfo.c diff -u src/sys/arch/atari/stand/tostools/libtos/sysinfo.c:1.9 src/sys/arch/atari/stand/tostools/libtos/sysinfo.c:1.10 --- src/sys/arch/atari/stand/tostools/libtos/sysinfo.c:1.9 Sat Mar 14 15:36:04 2009 +++ src/sys/arch/atari/stand/tostools/libtos/sysinfo.c Wed Sep 25 08:32:44 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: sysinfo.c,v 1.9 2009/03/14 15:36:04 dsl Exp $ */ +/* $NetBSD: sysinfo.c,v 1.10 2024/09/25 08:32:44 rin Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -43,6 +43,14 @@ #include "libtos.h" #include "tosdefs.h" #include "kparamb.h" + +/* + * ADDR_* defined in tosdefs.h are in the 0-th page, even if 4KB page, + * i.e., [0, 0x1000). This causes -Warray-bounds for GCC12 and later. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" + /* * Extract memory and CPU/FPU info from system. */ @@ -130,3 +138,5 @@ sys_info(osdsc_t *od) } while (jar[-2]); } } + +#pragma GCC diagnostic pop