Skip to content

Commit 652bf87

Browse files
committed
Remove all warnings features
All warnings features are now defined within `score_cpp_policies` so we have to remove them from here.
1 parent 0f5cb41 commit 652bf87

10 files changed

Lines changed: 24 additions & 547 deletions

‎docs/features.md‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,11 @@ the relevant build mode is active. All are enabled by default except where noted
8888
requires static system archives (unavailable on some toolchains, e.g. AutoSD).
8989

9090
## Warnings
91-
Opt-in / disabled by default unless noted otherwise.
92-
- **`minimal_warnings`** (both) — Baseline warning set (includes `-Wall`).
93-
Enabled by default on QNX; opt-in (disabled by default) on Linux.
94-
- **`strict_warnings`** (both) — Stricter warnings; implies `minimal_warnings`.
95-
- **`all_wall_warnings`** (Linux) — Broadest warning set; implies `strict_warnings`.
96-
- **`warnings_as_errors`** (both) — Adds `-Werror`.
91+
**Note:** Warning-level features (`minimal_warnings`, `strict_warnings`, `all_wall_warnings`, `warnings_as_errors`)
92+
have been migrated to [`score_cpp_policies`](https://github.com/eclipse-score/score_cpp_policies).
93+
94+
These features are no longer defined by this toolchain but can be provided through *feature injection* via
95+
the `extra_known_features` / `extra_enabled_features` attributes on `gcc.toolchain(...)`.
9796

9897
## Sanitizers (Linux, opt-in)
9998
Sanitizers are **not** defined by this toolchain. They are provided as

‎docs/test_suite.md‎

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,59 +43,48 @@ These tests verify that specific toolchain features are correctly implemented an
4343
- Tests `-iquote` quote search paths
4444
- Verifies `-isystem` system include paths
4545

46-
3. **`warnings_test`** - Warning level configuration
47-
- Tests strict_warnings, minimal_warnings, warnings_as_errors features
48-
- Includes code patterns that trigger specific warnings
49-
50-
4. **`warning_override_test`** - Warning feature override via user flags
51-
- Regression test verifying user flags (copts) can override enabled warning features
52-
- Enables both `strict_warnings` and `warnings_as_errors` features (making warnings into errors)
53-
- Provides conflicting `-Wno-shadow` via copts to override the warning
54-
- Validates that the flag ordering is correct: user_compile_flags comes after warning features,
55-
ensuring user flags take precedence. If ordering regresses, compilation will fail with an error.
56-
57-
5. **`coverage_test`** - Code coverage instrumentation
46+
3. **`coverage_test`** - Code coverage instrumentation
5847
- Verifies code coverage instrumentation flags are applied
5948
- Provides multiple code paths for coverage analysis
6049
- Can be analyzed with: `bazel coverage --combined_report=lcov //feature_verification:coverage_test`
6150

62-
6. **`pic_test`** - Position-Independent Code (`-fPIC`)
51+
4. **`pic_test`** - Position-Independent Code (`-fPIC`)
6352
- Tests -fPIC flag is correctly applied
6453
- Validates position-independent code patterns
6554
- Tests polymorphism, static variables, and C linkage with PIC
6655

67-
7. **`pthread_test`** - POSIX threading support
56+
5. **`pthread_test`** - POSIX threading support
6857
- Verifies `-lpthread` correctly links pthread library
6958
- Tests thread creation, synchronization, and joining
7059
- Validates multiple threads can safely access shared state
7160

72-
8. **`multifile_test`** - Multi-file compilation and archiving
61+
6. **`multifile_test`** - Multi-file compilation and archiving
7362
- Tests multiple source files compile into separate object files
7463
- Validates object files are combined by archiver into static libraries
7564
- Complex operations across multiple object files link correctly
7665

77-
9. **`whole_archive_test`** - Whole-archive linking (`-Wl,--whole-archive`)
66+
7. **`whole_archive_test`** - Whole-archive linking (`-Wl,--whole-archive`)
7867
- Verifies `-Wl,--whole-archive` and `-Wl,--no-whole-archive` work
7968
- Tests unused library symbols are linked when using whole-archive
8069

81-
10. **`preprocessor_defines_test`** - `preprocessor_defines` feature
70+
8. **`preprocessor_defines_test`** - `preprocessor_defines` feature
8271
- Injects defines via the `local_defines` attribute (routed through the
8372
`preprocessor_defines` feature), unlike `defines_test` which uses `copts`
8473
(routed through `user_compile_flags`)
8574

86-
11. **`include_dir_test`** - `include_paths` via the `includes` attribute
75+
9. **`include_dir_test`** - `include_paths` via the `includes` attribute
8776
- Includes a header exposed through a library's `includes` attribute,
8877
exercising the `-I`/`-isystem` search paths
8978

90-
12. **`user_link_flags_test`** - `user_link_flags` feature
79+
10. **`user_link_flags_test`** - `user_link_flags` feature
9180
- Passes a linker flag through `linkopts` (`-Wl,--defsym=...`) and checks the
9281
injected symbol's address at runtime
9382

94-
13. **`random_seed_test`** - `random_seed` feature
83+
11. **`random_seed_test`** - `random_seed` feature
9584
- Build-and-run smoke test exercising internal-linkage symbols governed by
9685
the reproducible-build random seed
9786

98-
14. **`fully_static_link_test`** - `fully_static_link` feature (`-static`)
87+
12. **`fully_static_link_test`** - `fully_static_link` feature (`-static`)
9988
- Verifies no shared objects are mapped at runtime (fully static binary)
10089
- Marked incompatible with toolchains lacking static system archives (AutoSD)
10190

@@ -286,16 +275,16 @@ when the host equals the target).
286275

287276
### All tests on the host (`//...`)
288277
```
289-
Executed 20 tests: 20 passed
278+
Executed 17 tests: 17 passed
290279
```
291280

292281
### Feature Verification Tests
293-
- The `feature_verification_tests` suite aggregates 13 tests. `warnings_test`
294-
is defined separately and is picked up by wildcard targets such as
295-
`//feature_verification/...`.
282+
- The `feature_verification_tests` suite aggregates 11 tests.
283+
**Note:** Warning-level tests (`warnings_test`, `warning_override_test`) have been migrated to
284+
[`score_cpp_policies`](https://github.com/eclipse-score/score_cpp_policies).
296285
- Expected output for the suite:
297286
```
298-
Executed 13 tests: 13 passed
287+
Executed 11 tests: 11 passed
299288
```
300289

301290
### Language and Standards Tests
@@ -324,8 +313,6 @@ tests/
324313
│ ├── user_link_flags_test.cpp
325314
│ ├── random_seed_test.cpp
326315
│ ├── fully_static_link_test.cpp
327-
│ ├── warnings_test.cpp
328-
│ ├── warning_override_test.cpp
329316
│ ├── coverage_test.cpp
330317
│ ├── pic_test_lib.h/cpp, pic_test.cpp
331318
│ ├── multifile_lib.h and multifile_lib_*.cpp

‎templates/linux/cc_toolchain_config.bzl.template‎

Lines changed: 3 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@ load(":flags.bzl",
3939
"DEFAULT_LINK_FLAGS",
4040
"DBG_COMPILE_FLAGS",
4141
"OPT_COMPILE_FLAGS",
42-
"MINIMAL_WARNINGS_FLAGS",
43-
"MINIMAL_C_WARNINGS_FLAGS",
44-
"MINIMAL_CXX_WARNINGS_FLAGS",
45-
"STRICT_WARNINGS_FLAGS",
46-
"STRICT_C_WARNINGS_FLAGS",
47-
"STRICT_CXX_WARNINGS_FLAGS",
48-
"ALL_WALL_WARNINGS",
49-
"ALL_WALL_C_WARNINGS",
50-
"ALL_WALL_CXX_WARNINGS",
51-
"WARNINGS_AS_ERRORS",
5242
)
5343

5444
all_cpp_compile_actions = [
@@ -292,76 +282,6 @@ def _impl(ctx):
292282
],
293283
)
294284

295-
minimal_warnings_feature = feature(
296-
name = "minimal_warnings",
297-
enabled = False,
298-
flag_sets = [
299-
flag_set(
300-
actions = all_compile_actions,
301-
flag_groups = MINIMAL_WARNINGS_FLAGS,
302-
),
303-
flag_set(
304-
actions = all_c_compile_actions,
305-
flag_groups = MINIMAL_C_WARNINGS_FLAGS,
306-
),
307-
flag_set(
308-
actions = all_cpp_compile_actions,
309-
flag_groups = MINIMAL_CXX_WARNINGS_FLAGS,
310-
),
311-
],
312-
)
313-
314-
strict_warnings_feature = feature(
315-
name = "strict_warnings",
316-
implies = ["minimal_warnings"],
317-
enabled = False,
318-
flag_sets = [
319-
flag_set(
320-
actions = all_compile_actions,
321-
flag_groups = STRICT_WARNINGS_FLAGS,
322-
),
323-
flag_set(
324-
actions = all_cpp_compile_actions,
325-
flag_groups = STRICT_CXX_WARNINGS_FLAGS,
326-
),
327-
flag_set(
328-
actions = all_c_compile_actions,
329-
flag_groups = STRICT_C_WARNINGS_FLAGS,
330-
),
331-
],
332-
)
333-
334-
all_wall_warnings_feature = feature(
335-
name = "all_wall_warnings",
336-
implies = ["strict_warnings"],
337-
enabled = False,
338-
flag_sets = [
339-
flag_set(
340-
actions = all_compile_actions,
341-
flag_groups = ALL_WALL_WARNINGS,
342-
),
343-
flag_set(
344-
actions = all_c_compile_actions,
345-
flag_groups = ALL_WALL_C_WARNINGS,
346-
),
347-
flag_set(
348-
actions = all_cpp_compile_actions,
349-
flag_groups = ALL_WALL_CXX_WARNINGS,
350-
),
351-
],
352-
)
353-
354-
warnings_as_errors_feature = feature(
355-
name = "warnings_as_errors",
356-
enabled = False,
357-
flag_sets = [
358-
flag_set(
359-
actions = all_compile_actions,
360-
flag_groups = WARNINGS_AS_ERRORS,
361-
),
362-
],
363-
)
364-
365285
extra_compile_flags = %{extra_compile_flags}
366286
extra_compile_flags_feature = feature(
367287
name = "extra_compile_flags",
@@ -1024,10 +944,9 @@ def _impl(ctx):
1024944
random_seed_feature,
1025945
include_paths_feature,
1026946
preprocessor_defines_feature,
1027-
minimal_warnings_feature,
1028-
strict_warnings_feature,
1029-
all_wall_warnings_feature,
1030-
warnings_as_errors_feature,
947+
extra_compile_flags_feature,
948+
extra_c_compile_flags_feature,
949+
extra_cxx_compile_flags_feature,
1031950
user_compile_flags_feature,
1032951
compiler_input_flags_feature,
1033952
compiler_output_flags_feature,
@@ -1051,9 +970,6 @@ def _impl(ctx):
1051970
fully_static_link_feature,
1052971
sysroot_link_flags_feature,
1053972
pthread_feature,
1054-
extra_compile_flags_feature,
1055-
extra_c_compile_flags_feature,
1056-
extra_cxx_compile_flags_feature,
1057973
extra_link_flags_feature,
1058974
opt_feature,
1059975
supports_dynamic_linker_feature,

0 commit comments

Comments
 (0)