Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified)) by mollari.NetBSD.org (Postfix) with ESMTPS id 042AD1A924F for ; Fri, 5 Mar 2021 16:31:51 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id 3D47084D2E; Fri, 5 Mar 2021 16:31:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 67B5884D23 for ; Fri, 5 Mar 2021 16:31:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id fFecbt4m7VA6 for ; Fri, 5 Mar 2021 16:31:50 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id E5B5984CFC for ; Fri, 5 Mar 2021 16:31:49 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id DDD26FA95; Fri, 5 Mar 2021 16:31:49 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 5 Mar 2021 16:31:49 +0000 From: "Roland Illig" Subject: CVS commit: src/tests/usr.bin/xlint/lint1 To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20210305163149.DDD26FA95@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Roland Illig" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: rillig Date: Fri Mar 5 16:31:49 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: msg_130.c Log Message: tests/lint: add test for incompatible enums in switch Neither lint nor GCC 10 nor Clang 8 have a warning for an enum type mismatch in a switch statement. GCC 10 issues a warning but completely misses the point of the mismatched enum types. It only warns because in this test, EVENING has the numeric value 3, which is out of bounds for enum color, where the valid range is from 0 to 2. It says: > msg_130.c:45:2: warning: > case value ‘3’ not in enumerated type ‘enum color’ [-Wswitch] Clang 8 behaves almost the same, it just doesn't mention the value of the constant, saying merely 'case value not in enumerated type'. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_130.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.