https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105963

            Bug ID: 105963
           Summary: -Woverlength-strings: don't underline the entire
                    offending string
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: egallager at gcc dot gnu.org
  Target Milestone: ---

So I have been trying to enable -Woverlength-strings in my GCC build, just to
see if it would work, and ran into this warning:

In file included from ../../fixincludes/fixincl.c:91:
../../fixincludes/fixincl.x:189:1: warning: string length ‘4756’ is greater
than the length ‘4095’ ISO C99 compilers are required to support
[-Woverlength-strings]
  189 | "/* This file prototypes the long double functions available on Mac
OS\n\
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  190 |    10.3.9.  */\n\
      |    ~~~~~~~~~~~~~~
  191 | #ifndef __MATH__\n\
      | ~~~~~~~~~~~~~~~~~~~
  192 | # undef __APPLE_CC__\n\
      | ~~~~~~~~~~~~~~~~~~~~~~~
  193 | # define __APPLE_CC__  1345\n\
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  194 | # include_next <architecture/ppc/math.h>\n\
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  195 | # undef __APPLE_CC__\n\
      | ~~~~~~~~~~~~~~~~~~~~~~~
  196 | # define __APPLE_CC__ 1\n\
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~
  197 | # ifndef __LIBMLDBL_COMPAT\n\
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  198 | #  ifdef __LONG_DOUBLE_128__\n\
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  199 | #   define __LIBMLDBL_COMPAT(sym) __asm(\"_\" #sym \"$LDBL128\")\n\
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  200 | #  else\n\
      | ~~~~~~~~~~
  201 | #   define __LIBMLDBL_COMPAT(sym)\n\
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  202 | #  endif /* __LONG_DOUBLE_128__ */\n\
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  203 | # endif /* __LIBMLDBL_COMPAT */\n\
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  204 | # ifdef __cplusplus\n\
      | ~~~~~~~~~~~~~~~~~~~~~~
  205 |    extern \"C\" {\n\
      |    ~~~~~~~~~~~~~~~~~
  206 | # endif\n\
      | ~~~~~~~~~~
  207 |   extern long double acosl( long double ) __LIBMLDBL_COMPAT(acosl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  208 |   extern long double asinl( long double ) __LIBMLDBL_COMPAT(asinl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  209 |   extern long double atanl( long double ) __LIBMLDBL_COMPAT(atanl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  210 |   extern long double atan2l( long double, long double )
__LIBMLDBL_COMPAT(atan2l);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  211 |   extern long double cosl( long double ) __LIBMLDBL_COMPAT(cosl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  212 |   extern long double sinl( long double ) __LIBMLDBL_COMPAT(sinl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  213 |   extern long double tanl( long double ) __LIBMLDBL_COMPAT(tanl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  214 |   extern long double acoshl( long double )
__LIBMLDBL_COMPAT(acoshl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  215 |   extern long double asinhl( long double )
__LIBMLDBL_COMPAT(asinhl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  216 |   extern long double atanhl( long double )
__LIBMLDBL_COMPAT(atanhl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  217 |   extern long double coshl( long double ) __LIBMLDBL_COMPAT(coshl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  218 |   extern long double sinhl( long double ) __LIBMLDBL_COMPAT(sinhl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  219 |   extern long double tanhl( long double ) __LIBMLDBL_COMPAT(tanhl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  220 |   extern long double expl( long double ) __LIBMLDBL_COMPAT(expl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  221 |   extern long double exp2l( long double ) __LIBMLDBL_COMPAT(exp2l);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  222 |   extern long double expm1l( long double )
__LIBMLDBL_COMPAT(expm1l);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  223 |   extern long double logl( long double ) __LIBMLDBL_COMPAT(logl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  224 |   extern long double log10l( long double )
__LIBMLDBL_COMPAT(log10l);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  225 |   extern long double log2l( long double ) __LIBMLDBL_COMPAT(log2l);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  226 |   extern long double log1pl( long double )
__LIBMLDBL_COMPAT(log1pl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  227 |   extern long double logbl( long double ) __LIBMLDBL_COMPAT(logbl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  228 |   extern long double modfl( long double, long double * )
__LIBMLDBL_COMPAT(modfl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  229 |   extern long double ldexpl( long double, int )
__LIBMLDBL_COMPAT(ldexpl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  230 |   extern long double frexpl( long double, int * )
__LIBMLDBL_COMPAT(frexpl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  231 |   extern int ilogbl( long double ) __LIBMLDBL_COMPAT(ilogbl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  232 |   extern long double scalbnl( long double, int )
__LIBMLDBL_COMPAT(scalbnl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  233 |   extern long double scalblnl( long double, long int )
__LIBMLDBL_COMPAT(scalblnl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  234 |   extern long double fabsl( long double ) __LIBMLDBL_COMPAT(fabsl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  235 |   extern long double cbrtl( long double ) __LIBMLDBL_COMPAT(cbrtl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  236 |   extern long double hypotl( long double, long double )
__LIBMLDBL_COMPAT(hypotl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  237 |   extern long double powl( long double, long double )
__LIBMLDBL_COMPAT(powl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  238 |   extern long double sqrtl( long double ) __LIBMLDBL_COMPAT(sqrtl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  239 |   extern long double erfl( long double ) __LIBMLDBL_COMPAT(erfl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  240 |   extern long double erfcl( long double ) __LIBMLDBL_COMPAT(erfcl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  241 |   extern long double lgammal( long double )
__LIBMLDBL_COMPAT(lgammal);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  242 |   extern long double tgammal( long double )
__LIBMLDBL_COMPAT(tgammal);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  243 |   extern long double ceill( long double ) __LIBMLDBL_COMPAT(ceill);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  244 |   extern long double floorl( long double )
__LIBMLDBL_COMPAT(floorl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  245 |   extern long double nearbyintl( long double )
__LIBMLDBL_COMPAT(nearbyintl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  246 |   extern long double rintl( long double ) __LIBMLDBL_COMPAT(rintl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  247 |   extern long int lrintl( long double ) __LIBMLDBL_COMPAT(lrintl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  248 |   extern long long int llrintl( long double )
__LIBMLDBL_COMPAT(llrintl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  249 |   extern long double roundl( long double )
__LIBMLDBL_COMPAT(roundl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  250 |   extern long int lroundl( long double ) __LIBMLDBL_COMPAT(lroundl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  251 |   extern long long int llroundl( long double )
__LIBMLDBL_COMPAT(llroundl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  252 |   extern long double truncl( long double )
__LIBMLDBL_COMPAT(truncl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  253 |   extern long double fmodl( long double, long double)
__LIBMLDBL_COMPAT(fmodl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  254 |   extern long double remainderl( long double, long double )
__LIBMLDBL_COMPAT(remainderl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  255 |   extern long double remquol( long double, long double, int * )
__LIBMLDBL_COMPAT(remquol);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  256 |   extern long double copysignl( long double, long double )
__LIBMLDBL_COMPAT(copysignl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  257 |   extern long double nanl( const char * ) __LIBMLDBL_COMPAT(nanl);\n\
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  258 |   extern long double nextafterl( long double, long double )
__LIBMLDBL_COMPAT(nextafterl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  259 |   extern long double nexttowardl( long double, long double )
__LIBMLDBL_COMPAT(nexttowardl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  260 |   extern long double fdiml( long double, long double )
__LIBMLDBL_COMPAT(fdiml);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  261 |   extern long double fmaxl( long double, long double )
__LIBMLDBL_COMPAT(fmaxl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  262 |   extern long double fminl( long double, long double )
__LIBMLDBL_COMPAT(fminl);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  263 |   extern long double fmal( long double, long double, long double )
__LIBMLDBL_COMPAT(fmal);\n\
      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  264 | # ifdef __cplusplus\n\
      | ~~~~~~~~~~~~~~~~~~~~~~
  265 |    }\n\
      |    ~~~~
  266 | # endif\n\
      | ~~~~~~~~~~
  267 | #endif /* __MATH__ */",
      | ~~~~~~~~~~~~~~~~~~~~~~

Does the whole string there really all need its own separate underlines there
on each individual line? Can't we just put a single underline under the last
line or something? Or find some other way to truncate the output? Like, maybe
put an ellipsis between the start and the end... The whole point of the warning
is that a string is too long, so if it's too long, printing the whole thing is
liable to flood your terminal output, so there should be a way to avoid that...

Reply via email to