lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170201165314.2588373-1-arnd@arndb.de>
Date:   Wed,  1 Feb 2017 17:52:38 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Oleg Drokin <oleg.drokin@...el.com>,
        Andreas Dilger <andreas.dilger@...el.com>,
        James Simmons <jsimmons@...radead.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Arnd Bergmann <arnd@...db.de>,
        "John L. Hammond" <john.hammond@...el.com>,
        Dmitry Eremin <dmitry.eremin@...el.com>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        lustre-devel@...ts.lustre.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] staging: lustre: shut up clang warnings on CLASSERT()

lustre uses a fake switch() statement as a compile-time assert, but unfortunately
each use of that causes a warning when building with clang:

drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2907:2: warning: no case matching constant switch condition '42'
drivers/staging/lustre/lnet/klnds/socklnd/../../../include/linux/libcfs/libcfs_private.h:294:36: note: expanded from macro 'CLASSERT'
 #define CLASSERT(cond) do {switch (42) {case (cond): case 0: break; } } while (0)

Adding a 'default:' label in there shuts up the warning.

Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/staging/lustre/include/linux/libcfs/libcfs_private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
index aab15d8112a4..2d5435029185 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
@@ -291,7 +291,7 @@ do {							    \
  *       value  after  conversion...
  *
  */
-#define CLASSERT(cond) do {switch (42) {case (cond): case 0: break; } } while (0)
+#define CLASSERT(cond) do {switch (42) {case (cond): case 0: default: break; } } while (0)
 
 /* max value for numeric network address */
 #define MAX_NUMERIC_VALUE 0xffffffff
-- 
2.9.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ