From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 293B6C49EAF for ; Sun, 27 Jun 2021 15:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E265B61C3D for ; Sun, 27 Jun 2021 15:24:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230505AbhF0P0X (ORCPT ); Sun, 27 Jun 2021 11:26:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbhF0P0W (ORCPT ); Sun, 27 Jun 2021 11:26:22 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE4F3C061574; Sun, 27 Jun 2021 08:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5TjA7PSFWDPnK1JEPwMyjrDO4IXpUkyVPH+qXipsLzI=; b=FB+cE5V6zlmQ3S9KW0NvTeKstw zq39qvfjji5PrG/b2xqx0jDeddwlfPRG8kdCN5zAI9uE7og3NneIPqxJNS+Z8VBRqJUTbXqBPNJ6f mp0NWmZOK6zAMqw9JBIZNHQf0W/cJniQ0Qtdbzn0vK1WUNMOjC2oStYpNsOdf3OeJO0g3Q/6Vqr8x Xj5djUGWwSgQmdJHrYN6XDqMJvgJnkkDCmdMqDYJN5sgCk409U8NTVlYqSBl64AT8fsYX5j9CJ1A0 ShhzJ7ENznjKRUkm9EAuALLMhmTBrmyhjjt5wFZuMLJKhqw9CXG8mtUcfH9Pv3UFCA+qwt/BMPPNM O/+TNZUw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxWd4-0020zz-Kw; Sun, 27 Jun 2021 15:23:31 +0000 Date: Sun, 27 Jun 2021 16:23:26 +0100 From: Matthew Wilcox To: Greg KH Cc: Roberto Sassu , zohar@linux.ibm.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 03/12] digest_lists: Basic definitions Message-ID: References: <20210625165614.2284243-1-roberto.sassu@huawei.com> <20210625165614.2284243-4-roberto.sassu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On Sun, Jun 27, 2021 at 12:53:47PM +0200, Greg KH wrote: > > +enum ops { DIGEST_LIST_ADD, DIGEST_LIST_DEL, DIGEST_LIST_OP__LAST }; > > + > > For enums you export to userspace, you need to specify the values so > that all compilers get them right. I've never heard that rule before. Where does it come from? https://en.cppreference.com/w/c/language/enum says: If enumeration-constant is not followed by = constant-expression, its value is the value one greater than the value of the previous enumerator in the same enumeration. The value of the first enumerator (if it does not use = constant-expression) is zero.