Browse Source

Trade: GCC 11 CAN YOU STOP with the pointless fucking warnings.

The "funniest" of all is that those get printed in a totally random
fashion. Some in Debug, some in Release, some not at all (like, half of
the MaterialDataTest doesn'ŧ initialize `state` and yet it doesn't
complain). Fuck these half-assed features that achieve nothing except
bullying people WHO KNOW WHAT THEY ARE DOING FFS.
pull/529/head
Vladimír Vondruš 5 years ago
parent
commit
360ca834e1
  1. 30
      src/Magnum/Trade/Test/ImageDataTest.cpp
  2. 34
      src/Magnum/Trade/Test/LightDataTest.cpp
  3. 4
      src/Magnum/Trade/Test/MaterialDataTest.cpp
  4. 2
      src/Magnum/Trade/Test/SkinDataTest.cpp

30
src/Magnum/Trade/Test/ImageDataTest.cpp

@ -201,7 +201,7 @@ namespace Vk {
void ImageDataTest::constructGeneric() { void ImageDataTest::constructGeneric() {
{ {
auto data = new char[4*4]; auto data = new char[4*4];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{PixelFormat::RGBA8Unorm, {1, 3}, Containers::Array<char>{data, 4*4}, &state}; ImageData2D a{PixelFormat::RGBA8Unorm, {1, 3}, Containers::Array<char>{data, 4*4}, &state};
CORRADE_COMPARE(a.dataFlags(), DataFlag::Owned|DataFlag::Mutable); CORRADE_COMPARE(a.dataFlags(), DataFlag::Owned|DataFlag::Mutable);
@ -220,7 +220,7 @@ void ImageDataTest::constructGeneric() {
CORRADE_COMPARE(a.importerState(), &state); CORRADE_COMPARE(a.importerState(), &state);
} { } {
auto data = new char[3*2]; auto data = new char[3*2];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{PixelStorage{}.setAlignment(1), ImageData2D a{PixelStorage{}.setAlignment(1),
PixelFormat::R16UI, {1, 3}, Containers::Array<char>{data, 3*2}, &state}; PixelFormat::R16UI, {1, 3}, Containers::Array<char>{data, 3*2}, &state};
@ -245,7 +245,7 @@ void ImageDataTest::constructImplementationSpecific() {
/* Single format */ /* Single format */
{ {
auto data = new char[3*12]; auto data = new char[3*12];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{PixelStorage{}.setAlignment(1), ImageData2D a{PixelStorage{}.setAlignment(1),
Vk::PixelFormat::R32G32B32F, {1, 3}, Containers::Array<char>{data, 3*12}, &state}; Vk::PixelFormat::R32G32B32F, {1, 3}, Containers::Array<char>{data, 3*12}, &state};
@ -268,7 +268,7 @@ void ImageDataTest::constructImplementationSpecific() {
/* Format + extra */ /* Format + extra */
{ {
auto data = new char[3*6]; auto data = new char[3*6];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{PixelStorage{}.setAlignment(1), ImageData2D a{PixelStorage{}.setAlignment(1),
GL::PixelFormat::RGB, GL::PixelType::UnsignedShort, {1, 3}, Containers::Array<char>{data, 3*6}, &state}; GL::PixelFormat::RGB, GL::PixelType::UnsignedShort, {1, 3}, Containers::Array<char>{data, 3*6}, &state};
@ -290,7 +290,7 @@ void ImageDataTest::constructImplementationSpecific() {
/* Manual pixel size */ /* Manual pixel size */
{ {
auto data = new char[3*6]; auto data = new char[3*6];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{PixelStorage{}.setAlignment(1), 666, 1337, 6, {1, 3}, Containers::Array<char>{data, 3*6}, &state}; ImageData2D a{PixelStorage{}.setAlignment(1), 666, 1337, 6, {1, 3}, Containers::Array<char>{data, 3*6}, &state};
CORRADE_COMPARE(a.dataFlags(), DataFlag::Owned|DataFlag::Mutable); CORRADE_COMPARE(a.dataFlags(), DataFlag::Owned|DataFlag::Mutable);
@ -313,7 +313,7 @@ void ImageDataTest::constructImplementationSpecific() {
void ImageDataTest::constructCompressedGeneric() { void ImageDataTest::constructCompressedGeneric() {
{ {
auto data = new char[8]; auto data = new char[8];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{CompressedPixelFormat::Bc1RGBAUnorm, {4, 4}, ImageData2D a{CompressedPixelFormat::Bc1RGBAUnorm, {4, 4},
Containers::Array<char>{data, 8}, &state}; Containers::Array<char>{data, 8}, &state};
@ -329,7 +329,7 @@ void ImageDataTest::constructCompressedGeneric() {
CORRADE_COMPARE(a.importerState(), &state); CORRADE_COMPARE(a.importerState(), &state);
} { } {
auto data = new char[8]; auto data = new char[8];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), ImageData2D a{CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}),
CompressedPixelFormat::Bc1RGBAUnorm, {4, 4}, CompressedPixelFormat::Bc1RGBAUnorm, {4, 4},
Containers::Array<char>{data, 8}, &state}; Containers::Array<char>{data, 8}, &state};
@ -351,7 +351,7 @@ void ImageDataTest::constructCompressedImplementationSpecific() {
/* Format with autodetection */ /* Format with autodetection */
{ {
auto data = new char[8]; auto data = new char[8];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), ImageData2D a{CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}),
GL::CompressedPixelFormat::RGBS3tcDxt1, {4, 4}, GL::CompressedPixelFormat::RGBS3tcDxt1, {4, 4},
Containers::Array<char>{data, 8}, &state}; Containers::Array<char>{data, 8}, &state};
@ -675,7 +675,7 @@ void ImageDataTest::constructCopy() {
void ImageDataTest::constructMoveGeneric() { void ImageDataTest::constructMoveGeneric() {
auto data = new char[3*16]; auto data = new char[3*16];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{PixelStorage{}.setAlignment(1), ImageData2D a{PixelStorage{}.setAlignment(1),
PixelFormat::RGBA32F, {1, 3}, Containers::Array<char>{data, 3*16}, &state}; PixelFormat::RGBA32F, {1, 3}, Containers::Array<char>{data, 3*16}, &state};
ImageData2D b(std::move(a)); ImageData2D b(std::move(a));
@ -718,7 +718,7 @@ void ImageDataTest::constructMoveGeneric() {
void ImageDataTest::constructMoveImplementationSpecific() { void ImageDataTest::constructMoveImplementationSpecific() {
auto data = new char[3*6]; auto data = new char[3*6];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{PixelStorage{}.setAlignment(1), ImageData2D a{PixelStorage{}.setAlignment(1),
GL::PixelFormat::RGB, GL::PixelType::UnsignedShort, {1, 3}, Containers::Array<char>{data, 3*6}, &state}; GL::PixelFormat::RGB, GL::PixelType::UnsignedShort, {1, 3}, Containers::Array<char>{data, 3*6}, &state};
ImageData2D b(std::move(a)); ImageData2D b(std::move(a));
@ -759,7 +759,7 @@ void ImageDataTest::constructMoveImplementationSpecific() {
void ImageDataTest::constructMoveCompressedGeneric() { void ImageDataTest::constructMoveCompressedGeneric() {
auto data = new char[8]; auto data = new char[8];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{ ImageData2D a{
CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}),
CompressedPixelFormat::Bc3RGBAUnorm, {4, 4}, Containers::Array<char>{data, 8}, &state}; CompressedPixelFormat::Bc3RGBAUnorm, {4, 4}, Containers::Array<char>{data, 8}, &state};
@ -796,7 +796,7 @@ void ImageDataTest::constructMoveCompressedGeneric() {
void ImageDataTest::constructMoveCompressedImplementationSpecific() { void ImageDataTest::constructMoveCompressedImplementationSpecific() {
auto data = new char[8]; auto data = new char[8];
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
ImageData2D a{ ImageData2D a{
CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}),
GL::CompressedPixelFormat::RGBS3tcDxt1, {4, 4}, Containers::Array<char>{data, 8}, &state}; GL::CompressedPixelFormat::RGBS3tcDxt1, {4, 4}, Containers::Array<char>{data, 8}, &state};
@ -833,7 +833,8 @@ void ImageDataTest::constructMoveCompressedImplementationSpecific() {
void ImageDataTest::constructMoveAttachState() { void ImageDataTest::constructMoveAttachState() {
auto data = new char[3*6]; auto data = new char[3*6];
int stateOld, stateNew; /* GCC 11 pointlessly complains that "maybe uninitialized" w/o the {} */
int stateOld{}, stateNew{};
ImageData2D a{PixelStorage{}.setAlignment(1), ImageData2D a{PixelStorage{}.setAlignment(1),
GL::PixelFormat::RGB, GL::PixelType::UnsignedShort, {1, 3}, Containers::Array<char>{data, 3*6}, &stateOld}; GL::PixelFormat::RGB, GL::PixelType::UnsignedShort, {1, 3}, Containers::Array<char>{data, 3*6}, &stateOld};
ImageData2D b{std::move(a), &stateNew}; ImageData2D b{std::move(a), &stateNew};
@ -855,7 +856,8 @@ void ImageDataTest::constructMoveAttachState() {
void ImageDataTest::constructMoveCompressedAttachState() { void ImageDataTest::constructMoveCompressedAttachState() {
auto data = new char[8]; auto data = new char[8];
int stateOld, stateNew; /* GCC 11 pointlessly complains that "maybe uninitialized" w/o the {} */
int stateOld{}, stateNew{};
ImageData2D a{ ImageData2D a{
CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}), CompressedPixelStorage{}.setCompressedBlockSize(Vector3i{4}),
GL::CompressedPixelFormat::RGBS3tcDxt1, {4, 4}, Containers::Array<char>{data, 8}, &stateOld}; GL::CompressedPixelFormat::RGBS3tcDxt1, {4, 4}, Containers::Array<char>{data, 8}, &stateOld};

34
src/Magnum/Trade/Test/LightDataTest.cpp

@ -102,7 +102,7 @@ LightDataTest::LightDataTest() {
void LightDataTest::construct() { void LightDataTest::construct() {
{ {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Spot, LightData data{LightData::Type::Spot,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
{0.1f, 0.5f, 0.7f}, 15.0f, {0.1f, 0.5f, 0.7f}, 15.0f,
@ -120,7 +120,7 @@ void LightDataTest::construct() {
/* Implicit spot angles */ /* Implicit spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Spot, LightData data{LightData::Type::Spot,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
{0.1f, 0.5f, 0.7f}, 15.0f, {0.1f, 0.5f, 0.7f}, 15.0f,
@ -137,7 +137,7 @@ void LightDataTest::construct() {
/* Implicit non-spot angles */ /* Implicit non-spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Point, LightData data{LightData::Type::Point,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
{0.1f, 0.5f, 0.7f}, 15.0f, {0.1f, 0.5f, 0.7f}, 15.0f,
@ -157,7 +157,7 @@ void LightDataTest::construct() {
void LightDataTest::constructAttenuation() { void LightDataTest::constructAttenuation() {
/* Implicit range */ /* Implicit range */
{ {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Spot, LightData data{LightData::Type::Spot,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
{0.1f, 0.5f, 0.7f}, {0.1f, 0.5f, 0.7f},
@ -175,7 +175,7 @@ void LightDataTest::constructAttenuation() {
/* Implicit range + spot angles */ /* Implicit range + spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Spot, LightData data{LightData::Type::Spot,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
{0.1f, 0.5f, 0.7f}, {0.1f, 0.5f, 0.7f},
@ -192,7 +192,7 @@ void LightDataTest::constructAttenuation() {
/* Implicit range + non-spot angles */ /* Implicit range + non-spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Point, LightData data{LightData::Type::Point,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
{0.1f, 0.5f, 0.7f}, {0.1f, 0.5f, 0.7f},
@ -212,7 +212,7 @@ void LightDataTest::constructAttenuation() {
void LightDataTest::constructRange() { void LightDataTest::constructRange() {
/* Implicit attenuation for a spot */ /* Implicit attenuation for a spot */
{ {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Spot, LightData data{LightData::Type::Spot,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
15.0f, 15.0f,
@ -230,7 +230,7 @@ void LightDataTest::constructRange() {
/* Implicit attenuation for a spot + spot angles */ /* Implicit attenuation for a spot + spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Spot, LightData data{LightData::Type::Spot,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
15.0f, 15.0f,
@ -247,7 +247,7 @@ void LightDataTest::constructRange() {
/* Implicit attenuation for a point + non-spot angles */ /* Implicit attenuation for a point + non-spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Point, LightData data{LightData::Type::Point,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
15.0f, 15.0f,
@ -264,7 +264,7 @@ void LightDataTest::constructRange() {
/* Implicit attenuation for an ambient + non-spot angles */ /* Implicit attenuation for an ambient + non-spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Ambient, LightData data{LightData::Type::Ambient,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
Constants::inf(), Constants::inf(),
@ -281,7 +281,7 @@ void LightDataTest::constructRange() {
/* Implicit attenuation for a directional + non-spot angles */ /* Implicit attenuation for a directional + non-spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Directional, LightData data{LightData::Type::Directional,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
Constants::inf(), Constants::inf(),
@ -301,7 +301,7 @@ void LightDataTest::constructRange() {
void LightDataTest::constructNone() { void LightDataTest::constructNone() {
/* Implicit attenuation + range for a spot */ /* Implicit attenuation + range for a spot */
{ {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Spot, LightData data{LightData::Type::Spot,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
15.0_degf, 35.0_degf, 15.0_degf, 35.0_degf,
@ -318,7 +318,7 @@ void LightDataTest::constructNone() {
/* Implicit attenuation + range for a spot + spot angles */ /* Implicit attenuation + range for a spot + spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Spot, LightData data{LightData::Type::Spot,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
&a}; &a};
@ -334,7 +334,7 @@ void LightDataTest::constructNone() {
/* Implicit attenuation + range for a point + non-spot angles */ /* Implicit attenuation + range for a point + non-spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Point, LightData data{LightData::Type::Point,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
&a}; &a};
@ -350,7 +350,7 @@ void LightDataTest::constructNone() {
/* Implicit attenuation for an ambient + non-spot angles */ /* Implicit attenuation for an ambient + non-spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Ambient, LightData data{LightData::Type::Ambient,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
&a}; &a};
@ -366,7 +366,7 @@ void LightDataTest::constructNone() {
/* Implicit attenuation for a directional + non-spot angles */ /* Implicit attenuation for a directional + non-spot angles */
} { } {
int a; int a{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData data{LightData::Type::Directional, LightData data{LightData::Type::Directional,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
&a}; &a};
@ -402,7 +402,7 @@ void LightDataTest::constructCopy() {
} }
void LightDataTest::constructMove() { void LightDataTest::constructMove() {
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
LightData a{LightData::Type::Spot, LightData a{LightData::Type::Spot,
0xccff33_rgbf, 0.8f, 0xccff33_rgbf, 0.8f,
{0.1f, 0.5f, 0.7f}, 15.0f, {0.1f, 0.5f, 0.7f}, 15.0f,

4
src/Magnum/Trade/Test/MaterialDataTest.cpp

@ -1188,7 +1188,7 @@ void MaterialDataTest::constructNonOwned() {
{"highlightColor"_s, Vector4{0.2f, 0.6f, 0.4f, 1.0f}} {"highlightColor"_s, Vector4{0.2f, 0.6f, 0.4f, 1.0f}}
}; };
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
MaterialData data{MaterialType::Phong, {}, attributes, &state}; MaterialData data{MaterialType::Phong, {}, attributes, &state};
/* Expecting the same output as in construct() */ /* Expecting the same output as in construct() */
@ -1230,7 +1230,7 @@ void MaterialDataTest::constructNonOwnedLayers() {
2, 5, 5, 7 2, 5, 5, 7
}; };
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
MaterialData data{MaterialType::Phong, MaterialData data{MaterialType::Phong,
{}, attributes, {}, attributes,
{}, layers, &state}; {}, layers, &state};

2
src/Magnum/Trade/Test/SkinDataTest.cpp

@ -69,7 +69,7 @@ void SkinDataTest::construct() {
} }
void SkinDataTest::constructNonOwned() { void SkinDataTest::constructNonOwned() {
int state; int state{}; /* GCC 11 complains that "maybe uninitialized" w/o the {} */
const UnsignedInt jointData[]{0, 2, 3}; const UnsignedInt jointData[]{0, 2, 3};
const Matrix4 inverseBindMatrixData[]{ const Matrix4 inverseBindMatrixData[]{
Matrix4::translation(Vector3::zAxis(0.0f)), Matrix4::translation(Vector3::zAxis(0.0f)),

Loading…
Cancel
Save