Remove the unnecessary -S option for modern clang.

Review Request #14733 — Created Dec. 11, 2025 and updated

Information

ReviewBot
release-5.x

Reviewers

A long time ago, the -S option that we passed to clang --analyze ...
used to matter to tell clang to compile to assembly and then stop. But
modern versions of clang now ignore any code generation related flags
when --analyze is passed, so this -S option isn't needed anymore.

Clang 15 and newer is more noisy about unused arguments during
compilation, so it was complaining about the -S. This change removes
the option from our command.

  • Ran integration unit tests with clang 20 and saw that the unused
    argument warnings that were causing a couple tests to fail went away.
Summary ID
Remove the unnecessary -S option for modern clang.
A long time ago, the `-S` option that we passed to `clang --analyze ...` used to matter to tell clang to compile to assembly and then stop. But modern versions of clang now ignore any code generation related flags when `--analyze` is passed, so this `-S` option isn't needed anymore. Clang 15 and newer is more noisy about unused arguments during compilation, so it was complaining about the `-S`. This change removes the option from our command.
db660d814037c98ae7802756969f028cfdab80e8
Description From Last Updated

This seems fine. I do wonder if this will break any existing users. We should at least note the minimum …

chipx86chipx86
Checks run (2 succeeded)
flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    This seems fine. I do wonder if this will break any existing users. We should at least note the minimum version of clang we now support in the docs.

    1. I doubt it'll break any existing users. I can't find a specific minimum version that states that -S gets ignored when --analyze is passed, but since --analyze tells clang to run the static analyzer instead of code-generation and -S only matters for code generation, it seems that -S has always been ignored even since the creation of our clang tool in 2017. I think I just assumed that the version of clang we used back when we created the tool (which would've been clang 3, 4 or 5) needed the -S since we included the -S in our command, but I can't find any proof to back up that claim. Seems more likely that we just added -S as a mistake or extra safeguard that wasn't even necessary. I'll update the description to clarify this.

      And good idea, we should note the minimum clang version. I'll take care of that in a separate change after I decide whether we should update our Ubuntu version for our Docker images (which we probably should), and see what minimum version of clang is available on the next Ubuntu version that we choose (we're currently on 20.04).

  3.