| Summary: | Remove compile warning (missing-field-initializers) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Hunseop Jeong <hs85.jeong> | ||||
| Component: | WebKitGTK | Assignee: | Hunseop Jeong <hs85.jeong> | ||||
| Status: | NEW --- | ||||||
| Severity: | Normal | CC: | bugs-noreply, cgarcia, commit-queue, koivisto, mcatanzaro, ossy | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Hunseop Jeong
2015-07-07 00:22:11 PDT
Created attachment 256285 [details]
Patch
Comment on attachment 256285 [details]
Patch
No, please don’t do this. Could you explain this warning?
-Wmissing-field-initializers
Warn if a structure's initializer has some fields missing. For
example, the following code causes such a warning, because "x.h" is
implicitly zero:
struct s { int f, g, h; };
struct s x = { 3, 4 };
This option does not warn about designated initializers, so the
following modification does not trigger a warning:
struct s { int f, g, h; };
struct s x = { .f = 3, .g = 4 };
In C++ this option does not warn either about the empty { }
initializer, for example:
struct s { int f, g, h; };
s x = { };
This warning is included in -Wextra. To get other -Wextra warnings
without this one, use -Wextra -Wno-missing-field-initializers.
But a quick check of NetworkCacheBlobStorage.cpp and NetworkCacheFileSystem.cpp shows that it's warning about { } even though it says it should not. That's odd.
I got this warnings when compiling the webkitgtk+ port.
gtk+ didn't use the -Wno-missing-field-initializers options.
According to comment of Michael Catanzaro, { } does not warn in C++. That's odd.
I use the ubuntu 15.04.
(In reply to comment #3) > In C++ this option does not warn either about the empty { } > initializer, for example: > > struct s { int f, g, h; }; > s x = { }; > > This warning is included in -Wextra. To get other -Wextra > warnings > without this one, use -Wextra -Wno-missing-field-initializers. > > But a quick check of NetworkCacheBlobStorage.cpp and > NetworkCacheFileSystem.cpp shows that it's warning about { } even though it > says it should not. That's odd. Unfortunately it is a GCC 5 only feature. GCC 4.9 still complains with empty initializers. :( (In reply to comment #5) > (In reply to comment #3) > > > In C++ this option does not warn either about the empty { } > > initializer, for example: > > > > struct s { int f, g, h; }; > > s x = { }; > > > > This warning is included in -Wextra. To get other -Wextra > > warnings > > without this one, use -Wextra -Wno-missing-field-initializers. > > > > But a quick check of NetworkCacheBlobStorage.cpp and > > NetworkCacheFileSystem.cpp shows that it's warning about { } even though it > > says it should not. That's odd. > > Unfortunately it is a GCC 5 only feature. > GCC 4.9 still complains with empty initializers. :( I tried to build with NETWORK_CACHE but build error was occurred by this warning in EFL. Do we wait for ubuntu 15.10? |