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

            Bug ID: 89554
           Summary: Incorrect location of warning
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: david.bolvansky at gmail dot com
  Target Milestone: ---

Found when building LLVM trunk with GCC 9 trunk (built today) compiler.


https://clang.llvm.org/doxygen/LiteralSupport_8cpp_source.html

 const char *End = saw_exponent ? ExponentBegin : SuffixBegin;
   for (const char *Ptr = DigitsBegin; Ptr < End; ++Ptr) {
     if (*Ptr == '.') {
       FoundDecimal = true;
       continue;


/home/xbolva00/LLVM/llvm-project/clang/lib/Lex/LiteralSupport.cpp:1127:43:
warning: ‘ExponentBegin’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
 1127 |   for (const char *Ptr = DigitsBegin; Ptr < End; ++Ptr) {

                                              ~~~~^~~~~

I would expect carret to be here: saw_exponent ? ExponentBegin : SuffixBegin;

                                                  ~~~~^~~~~


As side note: there are so many "-Wmaybe-uninitialized" warnings. You should
check them whether real issues or no (they spam build warning log very much) -
don't think so.

You should consider removing '-Wmaybe-uninitialized" from standard "-Wall
-Wextra".

Reply via email to