Re: [RFC][PATCH 03/12] digest_lists: Basic definitions

From
Matthew Wilcox <willy@infradead.org>
Date
2021-06-27 15:24:02
Also in
linux-integrity, linux-kselftest, linux-security-module, lkml
Reply to
Greg KH, 2021-06-27
On Sun, Jun 27, 2021 at 12:53:47PM +0200, Greg KH wrote:
quoted
+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.
Thread (25 messages) 25 messages, 4 authors, last reply 2021-06-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help