Module Name: src Committed By: martin Date: Sat Sep 14 13:46:30 UTC 2013
Modified Files: src/sys/sys: cdefs.h Log Message: Define a prologue/epilogue for CTASSERTs using local variables (to avoid warnings about decalarations of localy defined but unused types) To generate a diff of this commit: cvs rdiff -u -r1.110 -r1.111 src/sys/sys/cdefs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/sys/cdefs.h diff -u src/sys/sys/cdefs.h:1.110 src/sys/sys/cdefs.h:1.111 --- src/sys/sys/cdefs.h:1.110 Tue Sep 10 12:54:14 2013 +++ src/sys/sys/cdefs.h Sat Sep 14 13:46:30 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.110 2013/09/10 12:54:14 gsutre Exp $ */ +/* $NetBSD: cdefs.h,v 1.111 2013/09/14 13:46:30 martin Exp $ */ /* * Copyright (c) 1991, 1993 @@ -152,6 +152,18 @@ #define __CTASSERT1(x, y, z) typedef char y ## z[/*CONSTCOND*/(x) ? 1 : -1] /* + * Provide a prologue/epilogue for __CTASSERT uses within a local function + * to supress warnings about unused local typedefs + */ +#if __GNUC_PREREQ__(4, 8) +#define __CT_LOCAL_PROLOGUE _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wunused-local-typedefs\"") +#define __CT_LOCAL_EPILOGUE _Pragma("GCC diagnostic pop") +#else +#define __CT_LOCAL_PROLOGUE +#define __CT_LOCAL_EPILOGUE +#endif + +/* * The following macro is used to remove const cast-away warnings * from gcc -Wcast-qual; it should be used with caution because it * can hide valid errors; in particular most valid uses are in