]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
doc: Fix wrong documentation for -finput-charset [PR61896]
authorSandra Loosemore <sloosemore@baylibre.com>
Wed, 1 Apr 2026 04:59:45 +0000 (04:59 +0000)
committerSandra Loosemore <sloosemore@baylibre.com>
Wed, 1 Apr 2026 05:18:54 +0000 (05:18 +0000)
This patch fixes long-standing bugs in the documentation for
-finput-charset.  Support for getting the default charset from the
locale has been disabled since 2004.  The error behavior has never been
documented, and now there is -Winvalid-utf8 that should be mentioned
in this context too.

gcc/ChangeLog
PR c/61896
* doc/cppopts.texi (-finput-charset=): Remove long-obsolete
locale discussion.  Document behavior about ill-formed inputs.

gcc/doc/cppopts.texi

index e5ac751292bf2580a0b3d19aa354900426e28758..94490775509f4b240551d5e4b0592a721f99ad21 100644 (file)
@@ -372,13 +372,17 @@ problems with encodings that do not fit exactly in @code{wchar_t}.
 @cindex character set, input
 @item -finput-charset=@var{charset}
 Set the input character set, used for translation from the character
-set of the input file to the source character set used by GCC@.  If the
-locale does not specify, or GCC cannot get this information from the
-locale, the default is UTF-8.  This can be overridden by either the locale
-or this command-line option.  Currently the command-line option takes
-precedence if there's a conflict.  @var{charset} can be any encoding
+set of the input file to the source character set used by GCC@.  The
+default is UTF-8.  @var{charset} can be any encoding
 supported by the system's @code{iconv} library routine.
 
+If the input character set is UTF-8, warnings about ill-formed code
+unit sequences are issued if @option{-Winvalid-utf8} is enabled.
+Otherwise no diagnostics are issued when the input character set
+matches the execution character set.  If they are different,
+ill-formed code unit sequences result in an error during transcoding
+to the execution character set.
+
 @ifclear cppmanual
 @opindex fpch-deps
 @opindex fno-pch-deps