[File] [PATCH] Fix clang warnings

Avinash Sonawane rootkea at gmail.com
Fri Sep 24 12:36:55 UTC 2021


Hello!

Please find the attached patch which fixes the warnings produced by
clang.

On current master, clang throws these warnings:
```
...
seccomp.c:191:2: warning: missing field 'datum_b' initializer
[-Wmissing-field-initializers]
        ALLOW_IOCTL_RULE(FIONREAD);
        ^
seccomp.c:57:6: note: expanded from macro 'ALLOW_IOCTL_RULE'
            SCMP_CMP(1, SCMP_CMP_EQ, param)) == -1) \
            ^
/usr/include/seccomp.h:247:19: note: expanded from macro 'SCMP_CMP'
#define SCMP_CMP                SCMP_CMP64
                                ^
/usr/include/seccomp.h:246:60: note: expanded from macro 'SCMP_CMP64'
#define SCMP_CMP64(...)         ((struct scmp_arg_cmp){__VA_ARGS__})
                                                                  ^
seccomp.c:195:2: warning: missing field 'datum_b' initializer
[-Wmissing-field-initializers]
        ALLOW_IOCTL_RULE(TIOCGWINSZ);
        ^
seccomp.c:57:6: note: expanded from macro 'ALLOW_IOCTL_RULE'
            SCMP_CMP(1, SCMP_CMP_EQ, param)) == -1) \
            ^
/usr/include/seccomp.h:247:19: note: expanded from macro 'SCMP_CMP'
#define SCMP_CMP                SCMP_CMP64
                                ^
/usr/include/seccomp.h:246:60: note: expanded from macro 'SCMP_CMP64'
#define SCMP_CMP64(...)         ((struct scmp_arg_cmp){__VA_ARGS__})
                                                                  ^
seccomp.c:199:2: warning: missing field 'datum_b' initializer
[-Wmissing-field-initializers]
        ALLOW_IOCTL_RULE(TCGETS);
        ^
seccomp.c:57:6: note: expanded from macro 'ALLOW_IOCTL_RULE'
            SCMP_CMP(1, SCMP_CMP_EQ, param)) == -1) \
            ^
/usr/include/seccomp.h:247:19: note: expanded from macro 'SCMP_CMP'
#define SCMP_CMP                SCMP_CMP64
                                ^
/usr/include/seccomp.h:246:60: note: expanded from macro 'SCMP_CMP64'
#define SCMP_CMP64(...)         ((struct scmp_arg_cmp){__VA_ARGS__})
                                                                  ^
3 warnings generated.
...
test.c:79:6: warning: unused variable 'i' [-Wunused-variable]
        int i, e = EXIT_FAILURE;
            ^
1 warning generated.
...
```

Thanks!

Regards,
Avinash Sonawane (rootKea)
https://www.rootkea.me
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-clang-warnings.patch
Type: text/x-patch
Size: 1091 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20210924/d49c6f9e/attachment.bin>


More information about the File mailing list