-
Notifications
You must be signed in to change notification settings - Fork 3
mx_getopt.h: Initializers use same designator multiple times. Is this defined behavior? #131
Comments
donald
added a commit
that referenced
this issue
Apr 20, 2022
Enable -Wextra. Exclude -Wno-override-init for now, because mx_getopt.h relies on it [1]. [1]: #131
donald
added a commit
that referenced
this issue
May 5, 2022
Enable -Wextra. Exclude -Wno-override-init for now, because mx_getopt.h relies on it [1]. [1]: #131
donald
added a commit
that referenced
this issue
May 5, 2022
Enable -Wextra. Exclude -Wno-override-init for now, because mx_getopt.h relies on it [1]. [1]: #131
donald
added a commit
that referenced
this issue
May 5, 2022
Enable -Wextra. Exclude -Wno-override-init for now, because mx_getopt.h relies on it [1]. [1]: #131
donald
added a commit
that referenced
this issue
May 5, 2022
Enable -Wextra. Exclude -Wno-override-init for now, because mx_getopt.h relies on it [1]. [1]: #131
donald
added a commit
that referenced
this issue
May 5, 2022
Enable -Wextra. Exclude -Wno-override-init for now, because mx_getopt.h relies on it [1]. [1]: #131
donald
added a commit
that referenced
this issue
May 9, 2022
Enable -Wextra. Exclude -Wno-override-init for now, because mx_getopt.h relies on it [1]. [1]: #131
donald
added a commit
to mariux64/bee
that referenced
this issue
Jul 8, 2022
Enable -Wextra. Exclude -Wno-override-init for now, because bee_getopt.h relies on it. See [1] for similar issue in mxq. [1]: mariux64/mxq#131
donald
added a commit
to mariux64/bee
that referenced
this issue
Jul 8, 2022
Enable -Wextra. Exclude -Wno-override-init for now, because bee_getopt.h relies on it. See [1] for similar issue in mxq. [1]: mariux64/mxq#131
donald
added a commit
to mariux64/bee
that referenced
this issue
Jul 8, 2022
Enable -Wextra. Exclude -Wno-override-init for now, because bee_getopt.h relies on it. See [1] for similar issue in mxq. [1]: mariux64/mxq#131
donald
added a commit
to mariux64/bee
that referenced
this issue
Jul 8, 2022
Enable -Wextra. Exclude -Wno-override-init for now, because bee_getopt.h relies on it. See [1] for similar issue in mxq. [1]: mariux64/mxq#131
Merged commit 3f89869 ("Makefile: Enable -Wextra") includes |
Sign in
to join this conversation on GitHub.
mxq/mx_getopt.h
Line 87 in 3a519d7
To initialize a field multiple times by repeating a C11 designator seems to produce the expected results (last initalization is used). Gcc explicitly mentions that in its manual [1]. Clang produces the same code [2]. Probably all reasonable compilers will do so.
However, currently clang generates a warning ("initializer overrides prior initialization of this subobject [-Winitializer-overrides]") and gcc does so with -Wextra ("initialized field overwritten [-Woverride-init]"). I'm not sure about the standard, but the warnings might hint, that the standard does not define this.
[1]: https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html bottom of page
[2]: https://godbolt.org/z/so7KEv94T
The text was updated successfully, but these errors were encountered: