Source-Changes-HG archive

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

[src/trunk]: src/sys/sys Add comments explaining what __unused and __used are...



details:   https://anonhg.NetBSD.org/src/rev/9c2a3b87a418
branches:  trunk
changeset: 790846:9c2a3b87a418
user:      apb <apb%NetBSD.org@localhost>
date:      Fri Oct 25 08:47:30 2013 +0000

description:
Add comments explaining what __unused and __used are for.

diffstat:

 sys/sys/cdefs.h |  11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r 3b9cece79cad -r 9c2a3b87a418 sys/sys/cdefs.h
--- a/sys/sys/cdefs.h   Fri Oct 25 08:19:46 2013 +0000
+++ b/sys/sys/cdefs.h   Fri Oct 25 08:47:30 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdefs.h,v 1.113 2013/10/16 19:31:43 christos Exp $     */
+/*     $NetBSD: cdefs.h,v 1.114 2013/10/25 08:47:30 apb Exp $  */
 
 /*
  * Copyright (c) 1991, 1993
@@ -250,12 +250,21 @@
 #define        __noclone       /* nothing */
 #endif
 
+/*
+ * __unused: Note that variable might be unused.
+ * Do not warn if variable is unused.
+ */
 #if __GNUC_PREREQ__(2, 7)
 #define        __unused        __attribute__((__unused__))
 #else
 #define        __unused        /* delete */
 #endif
 
+/*
+ * __used: Note that variable is needed, even if it appears to be unused.
+ * Valid only for static variables.  Do not optimise variable away.
+ * Do not warn if variable is unused.
+ */
 #if __GNUC_PREREQ__(3, 1)
 #define        __used          __attribute__((__used__))
 #else



Home | Main Index | Thread Index | Old Index