Bug 98377 - bootstrapping failure on windows for floating_to_chars
Summary: bootstrapping failure on windows for floating_to_chars
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: ---
Assignee: Patrick Palka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-18 17:23 UTC by cqwrteur
Modified: 2020-12-20 18:59 UTC (History)
3 users (show)

See Also:
Host: x86_64-msys2-mingw-w64, windows 10
Target: x86_64-msys2-mingw-w64, windows 10
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-12-18 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cqwrteur 2020-12-18 17:23:33 UTC
../../../../../gcc-git/libstdc++-v3/src/c++17/floating_to_chars.cc: In function 'std::to_chars_result std::__floating_to_chars_precision(char*, char*, T, std::chars_format, int)':
../../../../../gcc-git/libstdc++-v3/src/c++17/floating_to_chars.cc:1132:11: error: 'output_length_upper_bound' was not declared in this scope
 1132 |           output_length_upper_bound = (strlen("-d") + sizeof(radix)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../gcc-git/libstdc++-v3/src/c++17/floating_to_chars.cc:1138:15: error: 'output_length_upper_bound' was not declared in this scope
 1138 |               output_length_upper_bound = sign + approx_log10_value + 1;
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../gcc-git/libstdc++-v3/src/c++17/floating_to_chars.cc:1140:15: error: 'output_length_upper_bound' was not declared in this scope
 1140 |               output_length_upper_bound = sign + strlen("0");
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../gcc-git/libstdc++-v3/src/c++17/floating_to_chars.cc:1141:13: error: 'output_length_upper_bound' was not declared in this scope
 1141 |             output_length_upper_bound += sizeof(radix) + effective_precision;
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../gcc-git/libstdc++-v3/src/c++17/floating_to_chars.cc:1145:21: error: 'output_length_upper_bound' was not declared in this scope
 1145 |         char buffer[output_length_upper_bound+1];
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../gcc-git/libstdc++-v3/src/c++17/floating_to_chars.cc:1152:21: error: 'buffer' was not declared in this scope
 1152 |           = sprintf(buffer, output_specifier, effective_precision, value);
      |                     ^~~~~~
../../../../../gcc-git/libstdc++-v3/src/c++17/floating_to_chars.cc: In instantiation of 'std::to_chars_result std::__floating_to_chars_precision(char*, char*, T, std::chars_format, int) [with T = long double]':
../../../../../gcc-git/libstdc++-v3/src/c++17/floating_to_chars.cc:1546:76:   required from here
../../../../../gcc-git/libstdc++-v3/src/c++17/floating_to_chars.cc:1130:13: warning: unused variable 'output_length_upper_bound' [-Wunused-variable]
 1130 |         int output_length_upper_bound;
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../gcc-git/libstdc++-v3/src/c++17/floating_to_chars.cc:1163:33: error: could not convert '{<expression error>, ((std::size_t)output_length)}' from '<brace-enclosed initializer list>' to 'const string_view' {aka 'const std::basic_string_view<char>'}
 1163 |               const string_view buffer_sv = {buffer, (size_t)output_length};
      |                                 ^~~~~~~~~
      |                                 |
      |                                 <brace-enclosed initializer list>
make[5]: *** [Makefile:577: floating_to_chars.lo] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: Leaving directory '/home/unlvs/mingw-gcc-mcf-gthread/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3/src/c++17'
make[4]: *** [Makefile:764: all-recursive] Error 1
make[4]: Leaving directory '/home/unlvs/mingw-gcc-mcf-gthread/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3/src'
make[3]: *** [Makefile:568: all-recursive] Error 1
make[3]: Leaving directory '/home/unlvs/mingw-gcc-mcf-gthread/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3'
make[2]: *** [Makefile:493: all] Error 2
make[2]: Leaving directory '/home/unlvs/mingw-gcc-mcf-gthread/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3'
make[1]: *** [Makefile:12181: all-target-libstdc++-v3] Error 2
make[1]: Leaving directory '/home/unlvs/mingw-gcc-mcf-gthread/src/build-x86_64-w64-mingw32'
make: *** [Makefile:973: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
Comment 1 GCC Commits 2020-12-18 18:03:57 UTC
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:60cecb2b83ffcebac6e83076f5552df14b073248

commit r11-6261-g60cecb2b83ffcebac6e83076f5552df14b073248
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Dec 18 13:01:49 2020 -0500

    libstdc++: Fix mistake in PR98374 change [PR98377]
    
    The #ifdef RADIXCHAR directive should be moved one line up so that it
    also guards the outer if statement, or else when RADIXCHAR is not
    defined the outer if statement will end up nonsensically guarding the
    declaration of output_length_upper_bound a few lines below it.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/98377
            * src/c++17/floating_to_chars.cc (__floating_to_chars_precision):
            Fix mistake.
Comment 2 Patrick Palka 2020-12-18 18:07:13 UTC
Yikes, sorry about that.  Hopefully the build is clean for you now.  Thanks for the quick report.
Comment 3 cqwrteur 2020-12-19 02:01:56 UTC
(In reply to Patrick Palka from comment #2)
> Yikes, sorry about that.  Hopefully the build is clean for you now.  Thanks
> for the quick report.

fixed confirm.