diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 7f64aa41f1b7..881b40051974 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs.h,v 1.58 2004/12/11 05:59:00 christos Exp $ */ +/* $NetBSD: cdefs.h,v 1.59 2005/06/02 14:31:38 he Exp $ */ /* * Copyright (c) 1991, 1993 @@ -146,6 +146,15 @@ */ #define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) +/* + * The following macro is used to remove the volatile cast-away warnings + * from gcc -Wcast-qual; as above it should be used with caution + * because it can hide valid errors or warnings. Valid uses include + * making it possible to pass a volatile pointer to memset(). + * For the same reasons as above, we use unsigned long and not intptr_t. + */ +#define __UNVOLATILE(a) ((void *)(unsigned long)(volatile void *)(a)) + /* * GCC2 provides __extension__ to suppress warnings for various GNU C * language extensions under "-ansi -pedantic".