Debian Codegraph @

.cargo/vendor/cbindgen/tests/expectations/must_use.c

raw
1 #define MUST_USE_FUNC __attribute__((warn_unused_result))
2 #define MUST_USE_STRUCT __attribute__((warn_unused))
3 #define MUST_USE_ENUM /* nothing */
4
5
6 #include <stdarg.h>
7 #include <stdbool.h>
8 #include <stdint.h>
9 #include <stdlib.h>
10
11 enum MaybeOwnedPtr_i32_Tag {
12 Owned_i32,
13 None_i32,
14 };
15 typedef uint8_t MaybeOwnedPtr_i32_Tag;
16
17 typedef struct MUST_USE_STRUCT {
18 MaybeOwnedPtr_i32_Tag tag;
19 union {
20 struct {
21 int32_t *owned;
22 };
23 };
24 } MaybeOwnedPtr_i32;
25
26 typedef struct MUST_USE_STRUCT {
27 int32_t *ptr;
28 } OwnedPtr_i32;
29
30 MUST_USE_FUNC MaybeOwnedPtr_i32 maybe_consume(OwnedPtr_i32 input);