-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[libc] [Task] Prepare to enable disabled warnings #122835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 7 commits
00a77f0
3c023ed
bbec43a
badca59
1a2a90d
f375ca5
ba19d9a
90e7a06
d4b2fec
9c71b2a
fb7d4ba
26d4b30
dd8de4c
85acd9a
71dcc06
67ed339
be54a01
9e7c2f8
61e3690
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -241,17 +241,18 @@ function(_get_common_test_compile_options output_var c_test flags) | |
| list(APPEND compile_options "-ffixed-point") | ||
| endif() | ||
|
|
||
| # list(APPEND compile_options "-Wall") | ||
| # list(APPEND compile_options "-Wextra") | ||
| list(APPEND compile_options "-Wall") | ||
| list(APPEND compile_options "-Wextra") | ||
| # -DLIBC_WNO_ERROR=ON if you can't build cleanly with -Werror. | ||
| if(NOT LIBC_WNO_ERROR) | ||
| # list(APPEND compile_options "-Werror") | ||
| list(APPEND compile_options "-Werror") | ||
| list(APPEND compile_options "-Wno-global-constructors") | ||
| endif() | ||
nickdesaulniers marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # list(APPEND compile_options "-Wconversion") | ||
| # list(APPEND compile_options "-Wno-sign-conversion") | ||
| # list(APPEND compile_options "-Wimplicit-fallthrough") | ||
| # list(APPEND compile_options "-Wwrite-strings") | ||
| # list(APPEND compile_options "-Wextra-semi") | ||
| list(APPEND compile_options "-Wconversion") | ||
| list(APPEND compile_options "-Wno-sign-conversion") | ||
| list(APPEND compile_options "-Wimplicit-fallthrough") | ||
| list(APPEND compile_options "-Wwrite-strings") | ||
| list(APPEND compile_options "-Wextra-semi") | ||
| # Silence this warning because _Complex is a part of C99. | ||
| if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
| if(NOT c_test) | ||
|
|
@@ -262,13 +263,13 @@ function(_get_common_test_compile_options output_var c_test flags) | |
| list(APPEND compile_options "-Wno-gnu-imaginary-constant") | ||
| endif() | ||
| list(APPEND compile_options "-Wno-pedantic") | ||
| # if(NOT CMAKE_COMPILER_IS_GNUCXX) | ||
| # list(APPEND compile_options "-Wnewline-eof") | ||
| # list(APPEND compile_options "-Wnonportable-system-include-path") | ||
| # list(APPEND compile_options "-Wstrict-prototypes") | ||
| # list(APPEND compile_options "-Wthread-safety") | ||
| # list(APPEND compile_options "-Wglobal-constructors") | ||
| # endif() | ||
| if(NOT CMAKE_COMPILER_IS_GNUCXX) | ||
|
||
| list(APPEND compile_options "-Wnewline-eof") | ||
| list(APPEND compile_options "-Wnonportable-system-include-path") | ||
| list(APPEND compile_options "-Wstrict-prototypes") | ||
| list(APPEND compile_options "-Wthread-safety") | ||
| # list(APPEND compile_options "-Wglobal-constructors") # triggered in TEST_F implementation | ||
vinay-deshmukh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| endif() | ||
| endif() | ||
| set(${output_var} ${compile_options} PARENT_SCOPE) | ||
| endfunction() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ struct Message { | |
| // A trivial object to catch the Message, this enables custom logging and | ||
| // returning from the test function, see LIBC_TEST_SCAFFOLDING_ below. | ||
| struct Failure { | ||
| void operator=(Message msg) {} | ||
| void operator=(Message /*msg*/) {} | ||
|
||
| }; | ||
|
|
||
| struct RunContext { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,9 +72,9 @@ long int check_primitives(int first, ...) { | |
| count += args.next_var<unsigned long>(); | ||
| count += args.next_var<long long>(); | ||
| count += args.next_var<unsigned long long>(); | ||
| count += args.next_var<double>(); | ||
| count += args.next_var<double>(); | ||
| count += args.next_var<long double>(); | ||
| count += static_cast<long>(args.next_var<double>()); | ||
| count += static_cast<long>(args.next_var<double>()); | ||
| count += static_cast<long>(args.next_var<long double>()); | ||
|
||
| count += *args.next_var<int *>(); | ||
| return count; | ||
| } | ||
|
|
@@ -112,7 +112,8 @@ long int check_struct_type(int first, ...) { | |
|
|
||
| S s = args.next_var<S>(); | ||
| int last = args.next_var<int>(); | ||
| return s.c + s.s + s.i + s.l + s.f + s.d + last; | ||
| return s.c + s.s + s.i + s.l + static_cast<long>(s.f) + | ||
| static_cast<long>(s.d) + last; | ||
| } | ||
|
|
||
| TEST(LlvmLibcArgListTest, TestStructTypes) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.