Hi! On 2023-01-11T13:31:56+0100, Jakub Jelinek via Gcc-patches wrote: > On Wed, Jan 11, 2023 at 12:41:06PM +0100, Thomas Schwinge wrote: > > I think this should be reviewed by Joseph as option handling maintainer. Joseph, please? >> +@item -Wno-complain-wrong-lang >> +@opindex Wcomplain-wrong-lang >> +@opindex Wno-complain-wrong-lang >> +By default, we complain about command-line options that are not valid >> +for this front end. >> +This may be disabled with @code{-Wno-complain-wrong-lang}. > > I think this description is too short and confusing, it isn't clear what > "this" front end is, perhaps say "that are not valid for a front end > which compiles a particular source file"? > And certainly give an example and more explanation that the option is > mostly useful when a single compiler driver invocation is compiling > multiple sources written in different languages. Good suggestion, thanks. I've changed the documentation as follows: --- gcc/common.opt +++ gcc/common.opt Wcomplain-wrong-lang Common Var(warn_complain_wrong_lang) Init(1) Warning -Complain when a command-line option is not valid for this front end. +Complain when a command-line option is valid, but not applicable to the current front end. --- gcc/doc/invoke.texi +++ gcc/doc/invoke.texi @@ -8943,9 +8943,21 @@ Warn for variables that might be changed by @code{longjmp} or @item -Wno-complain-wrong-lang @opindex Wcomplain-wrong-lang @opindex Wno-complain-wrong-lang -By default, we complain about command-line options that are not valid -for this front end. -This may be disabled with @code{-Wno-complain-wrong-lang}. +By default, language front ends complain when a command-line option is +valid, but not applicable to that front end. +This may be disabled with @option{-Wno-complain-wrong-lang}, +which is mostly useful when invoking a single compiler driver for +multiple source files written in different languages, for example: + +@smallexample +$ g++ -fno-rtti a.cc b.f90 +@end smallexample + +The driver @file{g++} invokes the C++ front end to compile @file{a.cc} +and the Fortran front end to compile @file{b.f90}. +The latter front end diagnoses +@samp{f951: Warning: command-line option '-fno-rtti' is valid for C++/D/ObjC++ but not for Fortran}, +which may be disabled with @option{-Wno-complain-wrong-lang}. Is the attached v2 "Add '-Wno-complain-wrong-lang', and use it in 'gcc/testsuite/lib/target-supports.exp:check_compile' and elsewhere" OK? Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955