Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secret.c: appease -Wmissing-field-initializers #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andy-bower
Copy link
Contributor

Use C99 designators to avoid relying on assumptions about the order of fields in SecretSchema struct. This allows mcds to be built with -Wextra.

Fixes the following:

gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H   -I/usr/include/x86_64-linux-gnu -isystem /usr/include/mit-krb5 -I/usr/include/p11-kit-1  -I/usr/include/libxml2  -I/usr/include/libsecret-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -pthread     -Wextra -MT mcds-secret.o -MD -MP -MF .deps/mcds-secret.Tpo -c -o mcds-secret.o `test -f 'secret.c' || echo './'`secret.c
secret.c:64:1: warning: missing initializer for field ‘reserved’ of ‘SecretSchema’ [-Wmissing-field-initializers]
   64 | };
      | ^
In file included from /usr/include/libsecret-1/libsecret/secret-attributes.h:25,
                 from /usr/include/libsecret-1/libsecret/secret.h:22,
                 from secret.h:31,
                 from secret.c:47:
/usr/include/libsecret-1/libsecret/secret-schema.h:49:14: note: ‘reserved’ declared here
   49 |         gint reserved;
      |              ^~~~~~~~

Use C99 designators to avoid relying on assumptions about the order of fields
in SecretSchema struct.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant