diff options
Diffstat (limited to 'gcc/doc/trouble.texi')
-rw-r--r-- | gcc/doc/trouble.texi | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gcc/doc/trouble.texi b/gcc/doc/trouble.texi index 01c0c192d59..1cfc212f5ed 100644 --- a/gcc/doc/trouble.texi +++ b/gcc/doc/trouble.texi @@ -275,15 +275,19 @@ string its argument points to. @cindex @code{sscanf}, and constant strings @cindex @code{fscanf}, and constant strings @cindex @code{scanf}, and constant strings -Another consequence is that @code{sscanf} does not work on some very -old systems when passed a string constant as its format control string -or input. This is because @code{sscanf} incorrectly tries to write -into the string constant. Likewise @code{fscanf} and @code{scanf}. - -The solution to these problems is to change the program to use +@c APPLE LOCAL begin fwritable strings. +Another consequence is that @code{sscanf} does not work on some systems +when passed a string constant as its format control string or input. +This is because @code{sscanf} incorrectly tries to write into the string +constant. Likewise @code{fscanf} and @code{scanf}. + +@opindex fwritable-strings +The best solution to these problems is to change the program to use @code{char}-array variables with initialization strings for these -purposes instead of string constants. - +purposes instead of string constants. But if this is not possible, +you can use the @option{-fwritable-strings} flag, which directs GCC +to handle string constants the same way most C compilers do. +@c APPLE LOCAL end fwritable strings. @item @code{-2147483648} is positive. |