Skip to content

Commit 82b6374

Browse files
tpudlikCQ Bot Account
authored and
CQ Bot Account
committed
bazel: Enable -Wconversion by default
Allowlist all targets with violations. This change was largely autogenerated using, cat /tmp/targets.txt | xargs buildozer 'add features "-conversion_warnings"' where /tmp/targets.txt contained the list of broken targets copied from https://btx.cloud.google.com/invocations/2046c2cb-c67d-4ce6-bde1-7f6b17a64f25/targets. But some manual fixes were required (since some targets were generated by macros and could not be directly edited by buildozer). NO_IFTTT=Large scale compilaton option change. Bug: 259746255 Change-Id: I62c513434d46d945f84d388bec09e98d1b819b42 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/276754 Commit-Queue: Ted Pudlik <tpudlik@google.com> Reviewed-by: Wyatt Hepler <hepler@google.com> Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Docs-Not-Needed: Ted Pudlik <tpudlik@google.com>
1 parent 85faf90 commit 82b6374

File tree

110 files changed

+653
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+653
-3
lines changed

REPO.bazel

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ repo(
2323
# Pigweed, but not when compiling any dependencies hosted in external
2424
# repositories.
2525
features = [
26-
# TODO: https://pwbug.dev/259746255 - Uncomment this after all broken
27-
# targets are allowlisted.
28-
# "conversion_warnings",
26+
"conversion_warnings",
2927
"layering_check",
3028
],
3129
)

pw_allocator/BUILD.bazel

+44
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ cc_library(
119119
cc_library(
120120
name = "best_fit",
121121
hdrs = ["public/pw_allocator/best_fit.h"],
122+
features = ["-conversion_warnings"],
122123
strip_include_prefix = "public",
123124
deps = [
124125
":block_allocator",
@@ -132,6 +133,7 @@ cc_library(
132133
cc_library(
133134
name = "best_fit_block_allocator",
134135
hdrs = ["public/pw_allocator/best_fit_block_allocator.h"],
136+
features = ["-conversion_warnings"],
135137
strip_include_prefix = "public",
136138
deps = [
137139
":best_fit",
@@ -143,6 +145,7 @@ cc_library(
143145
name = "block_allocator",
144146
srcs = ["block_allocator.cc"],
145147
hdrs = ["public/pw_allocator/block_allocator.h"],
148+
features = ["-conversion_warnings"],
146149
implementation_deps = ["//pw_assert:check"],
147150
strip_include_prefix = "public",
148151
deps = [
@@ -166,6 +169,7 @@ cc_library(
166169
cc_library(
167170
name = "bucket_allocator",
168171
hdrs = ["public/pw_allocator/bucket_allocator.h"],
172+
features = ["-conversion_warnings"],
169173
strip_include_prefix = "public",
170174
deps = [
171175
":block_allocator",
@@ -179,6 +183,7 @@ cc_library(
179183
cc_library(
180184
name = "bucket_block_allocator",
181185
hdrs = ["public/pw_allocator/bucket_block_allocator.h"],
186+
features = ["-conversion_warnings"],
182187
strip_include_prefix = "public",
183188
deps = [":bucket_allocator"],
184189
)
@@ -187,6 +192,7 @@ cc_library(
187192
name = "buddy_allocator",
188193
srcs = ["buddy_allocator.cc"],
189194
hdrs = ["public/pw_allocator/buddy_allocator.h"],
195+
features = ["-conversion_warnings"],
190196
implementation_deps = [
191197
"//pw_assert:check",
192198
"//pw_bytes:alignment",
@@ -256,6 +262,7 @@ alias(
256262
cc_library(
257263
name = "dl_allocator",
258264
hdrs = ["public/pw_allocator/dl_allocator.h"],
265+
features = ["-conversion_warnings"],
259266
strip_include_prefix = "public",
260267
deps = [
261268
":block_allocator",
@@ -271,6 +278,7 @@ cc_library(
271278
cc_library(
272279
name = "dual_first_fit_block_allocator",
273280
hdrs = ["public/pw_allocator/dual_first_fit_block_allocator.h"],
281+
features = ["-conversion_warnings"],
274282
strip_include_prefix = "public",
275283
deps = [":first_fit"],
276284
)
@@ -291,6 +299,7 @@ cc_library(
291299
cc_library(
292300
name = "first_fit",
293301
hdrs = ["public/pw_allocator/first_fit.h"],
302+
features = ["-conversion_warnings"],
294303
strip_include_prefix = "public",
295304
deps = [
296305
":block_allocator",
@@ -304,6 +313,7 @@ cc_library(
304313
cc_library(
305314
name = "first_fit_block_allocator",
306315
hdrs = ["public/pw_allocator/first_fit_block_allocator.h"],
316+
features = ["-conversion_warnings"],
307317
strip_include_prefix = "public",
308318
deps = [":first_fit"],
309319
)
@@ -312,12 +322,14 @@ cc_library(
312322
name = "fragmentation",
313323
srcs = ["fragmentation.cc"],
314324
hdrs = ["public/pw_allocator/fragmentation.h"],
325+
features = ["-conversion_warnings"],
315326
strip_include_prefix = "public",
316327
)
317328

318329
cc_library(
319330
name = "freelist_heap",
320331
hdrs = ["public/pw_allocator/freelist_heap.h"],
332+
features = ["-conversion_warnings"],
321333
strip_include_prefix = "public",
322334
deps = [
323335
":bucket_allocator",
@@ -341,6 +353,7 @@ cc_library(
341353
cc_library(
342354
name = "last_fit_block_allocator",
343355
hdrs = ["public/pw_allocator/last_fit_block_allocator.h"],
356+
features = ["-conversion_warnings"],
344357
strip_include_prefix = "public",
345358
deps = [":first_fit"],
346359
)
@@ -404,6 +417,7 @@ cc_library(
404417
cc_library(
405418
name = "tlsf_allocator",
406419
hdrs = ["public/pw_allocator/tlsf_allocator.h"],
420+
features = ["-conversion_warnings"],
407421
strip_include_prefix = "public",
408422
deps = [
409423
":block_allocator",
@@ -442,6 +456,7 @@ cc_library(
442456
cc_library(
443457
name = "worst_fit",
444458
hdrs = ["public/pw_allocator/worst_fit.h"],
459+
features = ["-conversion_warnings"],
445460
strip_include_prefix = "public",
446461
deps = [
447462
":block_allocator",
@@ -455,6 +470,7 @@ cc_library(
455470
cc_library(
456471
name = "worst_fit_block_allocator",
457472
hdrs = ["public/pw_allocator/worst_fit_block_allocator.h"],
473+
features = ["-conversion_warnings"],
458474
strip_include_prefix = "public",
459475
deps = [
460476
":config",
@@ -468,6 +484,7 @@ cc_library(
468484
name = "testing",
469485
testonly = True,
470486
hdrs = ["public/pw_allocator/testing.h"],
487+
features = ["-conversion_warnings"],
471488
strip_include_prefix = "public",
472489
deps = [
473490
":buffer",
@@ -489,6 +506,7 @@ cc_library(
489506
testonly = True,
490507
srcs = ["block_allocator_testing.cc"],
491508
hdrs = ["public/pw_allocator/block_allocator_testing.h"],
509+
features = ["-conversion_warnings"],
492510
implementation_deps = [
493511
"//pw_assert:check",
494512
"//pw_bytes:alignment",
@@ -514,6 +532,7 @@ cc_library(
514532
testonly = True,
515533
srcs = ["managed_ptr_testing.cc"],
516534
hdrs = ["public/pw_allocator/internal/managed_ptr_testing.h"],
535+
features = ["-conversion_warnings"],
517536
strip_include_prefix = "public",
518537
deps = [
519538
":pw_allocator",
@@ -559,6 +578,7 @@ cc_library(
559578
pw_cc_test(
560579
name = "allocator_as_pool_test",
561580
srcs = ["allocator_as_pool_test.cc"],
581+
features = ["-conversion_warnings"],
562582
deps = [
563583
":allocator_as_pool",
564584
":pw_allocator",
@@ -569,6 +589,7 @@ pw_cc_test(
569589
pw_cc_test(
570590
name = "allocator_test",
571591
srcs = ["allocator_test.cc"],
592+
features = ["-conversion_warnings"],
572593
deps = [
573594
":pw_allocator",
574595
":testing",
@@ -578,6 +599,7 @@ pw_cc_test(
578599
pw_cc_test(
579600
name = "best_fit_test",
580601
srcs = ["best_fit_test.cc"],
602+
features = ["-conversion_warnings"],
581603
deps = [
582604
":best_fit",
583605
":best_fit_block_allocator",
@@ -589,6 +611,7 @@ pw_cc_test(
589611
pw_cc_test(
590612
name = "bucket_allocator_test",
591613
srcs = ["bucket_allocator_test.cc"],
614+
features = ["-conversion_warnings"],
592615
deps = [
593616
":block_allocator_testing",
594617
":bucket_allocator",
@@ -600,6 +623,7 @@ pw_cc_test(
600623
pw_cc_test(
601624
name = "buddy_allocator_test",
602625
srcs = ["buddy_allocator_test.cc"],
626+
features = ["-conversion_warnings"],
603627
deps = [
604628
":buddy_allocator",
605629
":fuzzing",
@@ -610,6 +634,7 @@ pw_cc_test(
610634
pw_cc_test(
611635
name = "buffer_test",
612636
srcs = ["buffer_test.cc"],
637+
features = ["-conversion_warnings"],
613638
deps = [
614639
":buffer",
615640
":testing",
@@ -622,6 +647,7 @@ pw_cc_test(
622647
pw_cc_test(
623648
name = "bump_allocator_test",
624649
srcs = ["bump_allocator_test.cc"],
650+
features = ["-conversion_warnings"],
625651
deps = [
626652
":bump_allocator",
627653
":testing",
@@ -632,6 +658,7 @@ pw_cc_test(
632658
pw_cc_test(
633659
name = "chunk_pool_test",
634660
srcs = ["chunk_pool_test.cc"],
661+
features = ["-conversion_warnings"],
635662
deps = [
636663
":chunk_pool",
637664
":testing",
@@ -641,6 +668,7 @@ pw_cc_test(
641668
pw_cc_test(
642669
name = "dl_allocator_test",
643670
srcs = ["dl_allocator_test.cc"],
671+
features = ["-conversion_warnings"],
644672
deps = [
645673
":block_allocator_testing",
646674
":dl_allocator",
@@ -651,6 +679,7 @@ pw_cc_test(
651679
pw_cc_test(
652680
name = "fallback_allocator_test",
653681
srcs = ["fallback_allocator_test.cc"],
682+
features = ["-conversion_warnings"],
654683
deps = [
655684
":fallback_allocator",
656685
":testing",
@@ -661,6 +690,7 @@ pw_cc_test(
661690
pw_cc_test(
662691
name = "first_fit_test",
663692
srcs = ["first_fit_test.cc"],
693+
features = ["-conversion_warnings"],
664694
deps = [
665695
":block_allocator_testing",
666696
":buffer",
@@ -676,6 +706,7 @@ pw_cc_test(
676706
pw_cc_test(
677707
name = "fragmentation_test",
678708
srcs = ["fragmentation_test.cc"],
709+
features = ["-conversion_warnings"],
679710
deps = [
680711
":fragmentation",
681712
":testing",
@@ -685,6 +716,7 @@ pw_cc_test(
685716
pw_cc_test(
686717
name = "freelist_heap_test",
687718
srcs = ["freelist_heap_test.cc"],
719+
features = ["-conversion_warnings"],
688720
deps = [
689721
":freelist_heap",
690722
":testing",
@@ -697,6 +729,7 @@ pw_cc_test(
697729
pw_cc_test(
698730
name = "layout_test",
699731
srcs = ["layout_test.cc"],
732+
features = ["-conversion_warnings"],
700733
deps = [
701734
":pw_allocator",
702735
":testing",
@@ -708,6 +741,7 @@ pw_cc_test(
708741
pw_cc_test(
709742
name = "libc_allocator_test",
710743
srcs = ["libc_allocator_test.cc"],
744+
features = ["-conversion_warnings"],
711745
deps = [
712746
":libc_allocator",
713747
":testing",
@@ -723,6 +757,7 @@ pw_cc_test(
723757
pw_cc_test(
724758
name = "null_allocator_test",
725759
srcs = ["null_allocator_test.cc"],
760+
features = ["-conversion_warnings"],
726761
deps = [
727762
":null_allocator",
728763
":testing",
@@ -732,6 +767,7 @@ pw_cc_test(
732767
pw_cc_test(
733768
name = "pmr_allocator_test",
734769
srcs = ["pmr_allocator_test.cc"],
770+
features = ["-conversion_warnings"],
735771
deps = [
736772
":pmr_allocator",
737773
":testing",
@@ -741,6 +777,7 @@ pw_cc_test(
741777
pw_cc_test(
742778
name = "shared_ptr_test",
743779
srcs = ["shared_ptr_test.cc"],
780+
features = ["-conversion_warnings"],
744781
deps = [
745782
":managed_ptr_testing",
746783
":pw_allocator",
@@ -750,6 +787,7 @@ pw_cc_test(
750787
pw_cc_test(
751788
name = "synchronized_allocator_test",
752789
srcs = ["synchronized_allocator_test.cc"],
790+
features = ["-conversion_warnings"],
753791
# TODO: b/358411629 - This test times out on rp2.
754792
target_compatible_with = select({
755793
"@pico-sdk//bazel/constraint:rp2040": ["@platforms//:incompatible"],
@@ -777,6 +815,7 @@ pw_cc_test(
777815
pw_cc_test(
778816
name = "tlsf_allocator_test",
779817
srcs = ["tlsf_allocator_test.cc"],
818+
features = ["-conversion_warnings"],
780819
deps = [
781820
":block_allocator_testing",
782821
":tlsf_allocator",
@@ -786,6 +825,7 @@ pw_cc_test(
786825
pw_cc_test(
787826
name = "tracking_allocator_test",
788827
srcs = ["tracking_allocator_test.cc"],
828+
features = ["-conversion_warnings"],
789829
deps = [
790830
":first_fit",
791831
":metrics",
@@ -800,6 +840,7 @@ pw_cc_test(
800840
pw_cc_test(
801841
name = "typed_pool_test",
802842
srcs = ["typed_pool_test.cc"],
843+
features = ["-conversion_warnings"],
803844
deps = [
804845
":pw_allocator",
805846
":testing",
@@ -811,6 +852,7 @@ pw_cc_test(
811852
pw_cc_test(
812853
name = "unique_ptr_test",
813854
srcs = ["unique_ptr_test.cc"],
855+
features = ["-conversion_warnings"],
814856
deps = [
815857
":managed_ptr_testing",
816858
":pw_allocator",
@@ -820,6 +862,7 @@ pw_cc_test(
820862
pw_cc_test(
821863
name = "weak_ptr_test",
822864
srcs = ["weak_ptr_test.cc"],
865+
features = ["-conversion_warnings"],
823866
deps = [
824867
":managed_ptr_testing",
825868
":pw_allocator",
@@ -829,6 +872,7 @@ pw_cc_test(
829872
pw_cc_test(
830873
name = "worst_fit_test",
831874
srcs = ["worst_fit_test.cc"],
875+
features = ["-conversion_warnings"],
832876
deps = [
833877
":block_allocator_testing",
834878
":worst_fit",

0 commit comments

Comments
 (0)