Commit efa898ac by James Darpinian Committed by Commit Bot

Enable some compiler warnings used by WebKit.

This will make it easier to roll ANGLE in WebKit. Bug: angleproject:3439 Change-Id: Icd4a5a2d5dcabb6cf13d4b46a7547f49610fa4b3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1743057 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 08b1e660
...@@ -131,6 +131,13 @@ config("extra_warnings") { ...@@ -131,6 +131,13 @@ config("extra_warnings") {
"-Wunneeded-internal-declaration", "-Wunneeded-internal-declaration",
"-Wglobal-constructors", "-Wglobal-constructors",
"-Wexit-time-destructors", "-Wexit-time-destructors",
# The below warnings are used by WebKit. We enable them to make rolling
# ANGLE in WebKit easier.
"-Wparentheses",
"-Wrange-loop-analysis",
"-Wstrict-prototypes",
"-Wunreachable-code",
] ]
} }
} }
......
...@@ -85,6 +85,9 @@ ...@@ -85,6 +85,9 @@
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
# pragma warning(disable : 4065 4244 4701 4702) # pragma warning(disable : 4065 4244 4701 4702)
#endif #endif
#if defined(__clang__)
# pragma clang diagnostic ignored "-Wunreachable-code"
#endif
#include "ExpressionParser.h" #include "ExpressionParser.h"
...@@ -455,9 +458,9 @@ static const yytype_uint8 yytranslate[] = { ...@@ -455,9 +458,9 @@ static const yytype_uint8 yytranslate[] = {
#if YYDEBUG #if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = {0, 108, 108, 115, 116, 127, 127, 148, 148, 169, static const yytype_uint16 yyrline[] = {0, 111, 111, 118, 119, 130, 130, 151, 151, 172,
172, 175, 178, 181, 184, 187, 190, 193, 196, 221, 175, 178, 181, 184, 187, 190, 193, 196, 199, 224,
243, 246, 249, 275, 302, 305, 308, 311, 323, 326}; 246, 249, 252, 278, 305, 308, 311, 314, 326, 329};
#endif #endif
#if YYDEBUG || YYERROR_VERBOSE || 0 #if YYDEBUG || YYERROR_VERBOSE || 0
......
...@@ -30,6 +30,9 @@ WHICH GENERATES THE GLSL ES preprocessor expression parser. ...@@ -30,6 +30,9 @@ WHICH GENERATES THE GLSL ES preprocessor expression parser.
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#pragma warning(disable: 4065 4244 4701 4702) #pragma warning(disable: 4065 4244 4701 4702)
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunreachable-code"
#endif
#include "ExpressionParser.h" #include "ExpressionParser.h"
......
...@@ -702,6 +702,7 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh. ...@@ -702,6 +702,7 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
# pragma GCC diagnostic ignored "-Wimplicit-fallthrough" # pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
// Flex isn't semi-colon clean. // Flex isn't semi-colon clean.
# pragma clang diagnostic ignored "-Wextra-semi-stmt" # pragma clang diagnostic ignored "-Wextra-semi-stmt"
# pragma clang diagnostic ignored "-Wunreachable-code"
#endif #endif
// Workaround for flex using the register keyword, deprecated in C++11. // Workaround for flex using the register keyword, deprecated in C++11.
......
...@@ -43,6 +43,7 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh. ...@@ -43,6 +43,7 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
// Flex isn't semi-colon clean. // Flex isn't semi-colon clean.
#pragma clang diagnostic ignored "-Wextra-semi-stmt" #pragma clang diagnostic ignored "-Wextra-semi-stmt"
#pragma clang diagnostic ignored "-Wunreachable-code"
#endif #endif
// Workaround for flex using the register keyword, deprecated in C++11. // Workaround for flex using the register keyword, deprecated in C++11.
......
...@@ -42,6 +42,7 @@ WHICH GENERATES THE GLSL ES LEXER (glslang_lex.cpp). ...@@ -42,6 +42,7 @@ WHICH GENERATES THE GLSL ES LEXER (glslang_lex.cpp).
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
// Flex isn't semi-colon clean. // Flex isn't semi-colon clean.
#pragma clang diagnostic ignored "-Wextra-semi-stmt" #pragma clang diagnostic ignored "-Wextra-semi-stmt"
#pragma clang diagnostic ignored "-Wunreachable-code"
#endif #endif
} }
......
...@@ -37,6 +37,9 @@ WHICH GENERATES THE GLSL ES PARSER (glslang_tab.cpp AND glslang_tab.h). ...@@ -37,6 +37,9 @@ WHICH GENERATES THE GLSL ES PARSER (glslang_tab.cpp AND glslang_tab.h).
#pragma warning(disable: 4701) #pragma warning(disable: 4701)
#pragma warning(disable: 4702) #pragma warning(disable: 4702)
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunreachable-code"
#endif
#include "angle_gl.h" #include "angle_gl.h"
#include "compiler/translator/Declarator.h" #include "compiler/translator/Declarator.h"
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
// Flex isn't semi-colon clean. // Flex isn't semi-colon clean.
#pragma clang diagnostic ignored "-Wextra-semi-stmt" #pragma clang diagnostic ignored "-Wextra-semi-stmt"
#pragma clang diagnostic ignored "-Wunreachable-code"
#endif #endif
......
...@@ -83,6 +83,9 @@ ...@@ -83,6 +83,9 @@
#pragma warning(disable: 4701) #pragma warning(disable: 4701)
#pragma warning(disable: 4702) #pragma warning(disable: 4702)
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunreachable-code"
#endif
#include "angle_gl.h" #include "angle_gl.h"
#include "compiler/translator/Declarator.h" #include "compiler/translator/Declarator.h"
...@@ -738,37 +741,37 @@ static const yytype_uint8 yytranslate[] = ...@@ -738,37 +741,37 @@ static const yytype_uint8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint16 yyrline[] =
{ {
0, 248, 248, 249, 252, 259, 262, 267, 272, 277, 0, 251, 251, 252, 255, 262, 265, 270, 275, 280,
282, 291, 297, 300, 303, 306, 309, 312, 318, 325, 285, 294, 300, 303, 306, 309, 312, 315, 321, 328,
331, 334, 342, 345, 351, 354, 360, 364, 371, 379, 334, 337, 345, 348, 354, 357, 363, 367, 374, 382,
382, 385, 391, 394, 397, 400, 407, 408, 409, 410, 385, 388, 394, 397, 400, 403, 410, 411, 412, 413,
418, 419, 422, 425, 432, 433, 436, 442, 443, 447, 421, 422, 425, 428, 435, 436, 439, 445, 446, 450,
454, 455, 458, 461, 464, 470, 471, 474, 480, 481, 457, 458, 461, 464, 467, 473, 474, 477, 483, 484,
488, 489, 496, 497, 504, 505, 511, 512, 518, 519, 491, 492, 499, 500, 507, 508, 514, 515, 521, 522,
525, 526, 532, 533, 539, 540, 541, 542, 546, 547, 528, 529, 535, 536, 542, 543, 544, 545, 549, 550,
548, 552, 556, 560, 564, 571, 574, 580, 587, 594, 551, 555, 559, 563, 567, 574, 577, 583, 590, 597,
597, 600, 604, 608, 612, 616, 620, 627, 634, 637, 600, 603, 607, 611, 615, 619, 623, 630, 637, 640,
644, 652, 669, 679, 682, 688, 692, 696, 700, 707, 647, 655, 672, 682, 685, 691, 695, 699, 703, 710,
714, 717, 721, 725, 730, 737, 741, 745, 749, 754, 717, 720, 724, 728, 733, 740, 744, 748, 752, 757,
761, 765, 771, 774, 780, 784, 791, 797, 801, 805, 764, 768, 774, 777, 783, 787, 794, 800, 804, 808,
808, 811, 820, 825, 829, 832, 835, 838, 841, 845, 811, 814, 823, 828, 832, 835, 838, 841, 844, 848,
848, 852, 855, 858, 861, 864, 867, 874, 881, 884, 851, 855, 858, 861, 864, 867, 870, 877, 884, 887,
887, 893, 900, 903, 909, 912, 915, 918, 924, 927, 890, 896, 903, 906, 912, 915, 918, 921, 927, 930,
934, 939, 946, 951, 962, 965, 968, 971, 974, 977, 937, 942, 949, 954, 965, 968, 971, 974, 977, 980,
981, 985, 989, 993, 997, 1001, 1005, 1009, 1013, 1017, 984, 988, 992, 996, 1000, 1004, 1008, 1012, 1016, 1020,
1021, 1025, 1029, 1033, 1037, 1041, 1045, 1049, 1053, 1057, 1024, 1028, 1032, 1036, 1040, 1044, 1048, 1052, 1056, 1060,
1061, 1068, 1071, 1074, 1077, 1080, 1083, 1086, 1089, 1092, 1064, 1071, 1074, 1077, 1080, 1083, 1086, 1089, 1092, 1095,
1095, 1098, 1101, 1104, 1107, 1110, 1113, 1116, 1119, 1122, 1098, 1101, 1104, 1107, 1110, 1113, 1116, 1119, 1122, 1125,
1125, 1128, 1131, 1141, 1148, 1155, 1158, 1161, 1164, 1167, 1128, 1131, 1134, 1144, 1151, 1158, 1161, 1164, 1167, 1170,
1170, 1173, 1176, 1179, 1182, 1185, 1188, 1191, 1194, 1197, 1173, 1176, 1179, 1182, 1185, 1188, 1191, 1194, 1197, 1200,
1205, 1205, 1208, 1208, 1214, 1217, 1223, 1226, 1233, 1237, 1208, 1208, 1211, 1211, 1217, 1220, 1226, 1229, 1236, 1240,
1243, 1246, 1252, 1256, 1260, 1261, 1267, 1268, 1269, 1270, 1246, 1249, 1255, 1259, 1263, 1264, 1270, 1271, 1272, 1273,
1271, 1272, 1273, 1277, 1281, 1281, 1281, 1288, 1289, 1293, 1274, 1275, 1276, 1280, 1284, 1284, 1284, 1291, 1292, 1296,
1293, 1294, 1294, 1299, 1303, 1310, 1314, 1321, 1322, 1326, 1296, 1297, 1297, 1302, 1306, 1313, 1317, 1324, 1325, 1329,
1332, 1336, 1345, 1345, 1352, 1355, 1361, 1365, 1371, 1371, 1335, 1339, 1348, 1348, 1355, 1358, 1364, 1368, 1374, 1374,
1376, 1376, 1380, 1380, 1388, 1391, 1397, 1400, 1406, 1410, 1379, 1379, 1383, 1383, 1391, 1394, 1400, 1403, 1409, 1413,
1417, 1420, 1423, 1426, 1429, 1437, 1443, 1449, 1452, 1458, 1420, 1423, 1426, 1429, 1432, 1440, 1446, 1452, 1455, 1461,
1458 1461
}; };
#endif #endif
......
...@@ -3783,7 +3783,7 @@ bool Program::linkValidateGlobalNames(InfoLog &infoLog) const ...@@ -3783,7 +3783,7 @@ bool Program::linkValidateGlobalNames(InfoLog &infoLog) const
// to see if there's a conflict or not. // to see if there's a conflict or not.
std::vector<BlockAndFieldPair> prevBlockFieldPairs = std::vector<BlockAndFieldPair> prevBlockFieldPairs =
uniformBlockFieldMap[field.name]; uniformBlockFieldMap[field.name];
for (const auto prevBlockFieldPair : prevBlockFieldPairs) for (const auto &prevBlockFieldPair : prevBlockFieldPairs)
{ {
const sh::InterfaceBlock *prevUniformBlock = prevBlockFieldPair.first; const sh::InterfaceBlock *prevUniformBlock = prevBlockFieldPair.first;
const sh::InterfaceBlockField *prevUniformBlockField = const sh::InterfaceBlockField *prevUniformBlockField =
......
...@@ -187,8 +187,9 @@ rx::SamplerImpl *Sampler::getImplementation() const ...@@ -187,8 +187,9 @@ rx::SamplerImpl *Sampler::getImplementation() const
angle::Result Sampler::syncState(const Context *context) angle::Result Sampler::syncState(const Context *context)
{ {
ASSERT(isDirty()); ASSERT(isDirty());
return mSampler->syncState(context, mDirty); angle::Result result = mSampler->syncState(context, mDirty);
mDirty = false; mDirty = result != angle::Result::Continue;
return result;
} }
void Sampler::signalDirtyState() void Sampler::signalDirtyState()
......
...@@ -167,7 +167,7 @@ void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd) { ...@@ -167,7 +167,7 @@ void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd) {
} }
} }
void app_dummy() { void app_dummy(void) {
} }
......
...@@ -334,7 +334,7 @@ void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd); ...@@ -334,7 +334,7 @@ void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd);
/** /**
* Dummy function you can call to ensure glue code isn't stripped. * Dummy function you can call to ensure glue code isn't stripped.
*/ */
void app_dummy(); void app_dummy(void);
/** /**
* This is the function that application code must implement, representing * This is the function that application code must implement, representing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment