[Chapel Merge] 20904 Stop tying Clang flags for extern blocks to the --cc-warnings flag

Branch: refs/heads/main
Revision: e7964ec1c3bd8b1407818d467ff0c6eba5646b33
Author: David Longnecker
Link: [Merge pull request] # 20904 from dlongnecke-cray:fix-extern-block-cc-warning Stop tying Clang flags for extern blocks to the --cc-warnings flag by dlongnecke-cray · Pull Request #20904 · chapel-lang/chapel · GitHub
Log Message:

[Merge pull request] # 20904 from dlongnecke-cray:fix-extern-block-cc-warning
Always add C warning flags to Clang invocation
Stop tying Clang flags for extern blocks to the --cc-warnings flag There is a large list of -W warning flags we pass to our internal Clang compiler when invoking it. These flags were not previously required and were tied to the --cc-warnings flag, which meant that it was possible for non-developer compiles to skip throwing the flags. This PR adjusts the invocation to always add the flags. They protect against a large class of "warnings" (that really ought to be errors) in C code that the Chapel backend does not know how to handle. For further justification: the --cc-warnings flag is intended to suppress warnings for generated C code, however C code in extern blocks is handwritten and is consumed only by the Chapel compiler. Since chpl is the only consumer, it seems fine to require that all code in extern blocks must compile using specific -W flags. The documentation could be updated to list the flags if needed. Reviewed by @vasslitvinov. Thanks! TESTING - linux64, standard Signed-off-by: David Longnecker