This attached patch is intended to clarify the '-x' option using '-x f77' as an example. I was not sure who should review.

Tested by inspecting the generated info file from make info.

OK for trunk and backport to 14?

Regards,

Jerry

Author: Jerry DeLisle <jvdeli...@gcc.gnu.org>
Date:   Wed Feb 26 17:26:26 2025 -0800

    GCC: Documentation of -x option

    This change updates information about the -x option to clarify
    that it does not ensure standards compliance. Sparked by
    discussions in the following PR.

        PR fortran/108369

    gcc/ChangeLog:

        * doc/invoke.texi: Add a note to clarify. Adjust some wording.

commit a933852fa177abd79f6a3de3a01fafa07ed6ddc6
Author: Jerry DeLisle <jvdeli...@gcc.gnu.org>
Date:   Wed Feb 26 17:26:26 2025 -0800

    GCC: Documentation of -x option
    
    This change updates information about the -x option to clarify
    that it does not ensure standards compliance. Sparked by
    discussions in the following PR.
    
            PR fortran/108369
    
    gcc/ChangeLog:
    
            * doc/invoke.texi: Add a note to clarify. Adjust some wording.

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index bad49a017cc..6f8bf392386 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1700,9 +1700,13 @@ f77  f77-cpp-input f95  f95-cpp-input
 go
 @end smallexample
 
+Note that @option{-x} does not imply a particular language standard.
+For example @option{-x f77} may also require @option{-std=legacy} for some older
+source codes.
+
 @item -x none
 Turn off any specification of a language, so that subsequent files are
-handled according to their file name suffixes (as they are if @option{-x}
+handled according to their file name suffixes (as if @option{-x}
 has not been used at all).
 @end table
 

Reply via email to