Mam:
QT
struct foo_t
{
int a, b;
};
int main()
{
struct foo_t foo = {
.a = 1,
//main.cpp:10: warning: missing initializer for member 'foo_t::b' [-Wmissing-field-initializers]
};
(void)foo;
return 0;
}
Szczegóły:
$ qmake
$ make
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I. -o main.o main.cpp
main.cpp: In function ‘int main()’:
main.cpp:11:5: warning: missing initializer for member ‘foo_t::b’ [-Wmissing-field-initializers]
};
^
g++ -m64 -Wl,-O1 -o untitled1 main.o -L/usr/lib/x86_64-linux-gnu -lQtCore -lpthread
$ g++ --version
g++ (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Kompilator xc16-gcc przy -Wall -Wextra nie daje tego warninga:
$ xc16-gcc --version
elf-gcc (Microchip Technology) 4.5.1 (XC16, Microchip v1.26) (A) Build date: Feb 19 2016
Part support version: 1.26 (A)
__XC16_VERSION__ == 1026
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.