Bug 117039 - [15 Regression] Build failure: libcpp/directives.cc:2078:34: error: unknown conversion type character '>' in format [-Werror=format=]
Summary: [15 Regression] Build failure: libcpp/directives.cc:2078:34: error: unknown c...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 15.0
: P3 normal
Target Milestone: 15.0
Assignee: Ken Matsui
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-09 06:28 UTC by Sergei Trofimovich
Modified: 2024-10-09 21:22 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-10-09 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich 2024-10-09 06:28:33 UTC
Noticed build failure on today's gcc-master from r15-4191-g821d56100e1110:

I suspect r15-4191-g821d56100e1110 to be a culprit.

/tmp/gb/./prev-gcc/xg++ -B/tmp/gb/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -nostdinc++ -B/tmp/gb/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/tmp/gb/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs  -I/tmp/gb/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu  -I/tmp/gb/prev-x86_64-pc-linux-gnu/libstdc++-v3/include  -I/home/slyfox/dev/git/gcc/libstdc++-v3/libsupc++ -L/tmp/gb/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/tmp/gb/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs  -I/home/slyfox/dev/git/gcc/libcpp -I. -I/home/slyfox/dev/git/gcc/libcpp/../include -I/home/slyfox/dev/git/gcc/libcpp/include  -g -O2 -fno-checking -gtoggle -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long -Werror -fno-exceptions -fno-rtti -I/home/slyfox/dev/git/gcc/libcpp -I. -I/home/slyfox/dev/git/gcc/libcpp/../include -I/home/slyfox/dev/git/gcc/libcpp/include    -c -o directives.o -MT directives.o -MMD -MP -MF .deps/directives.Tpo /home/slyfox/dev/git/gcc/libcpp/directives.cc
/home/slyfox/dev/git/gcc/libcpp/directives.cc: In function 'void do_pragma_once(cpp_reader*)':
/home/slyfox/dev/git/gcc/libcpp/directives.cc:2078:20: error: unknown conversion type character '<' in format [-Werror=format=]
 2078 |                  "%<#pragma once%> in main file");
      |                    ^
/home/slyfox/dev/git/gcc/libcpp/directives.cc:2078:34: error: unknown conversion type character '>' in format [-Werror=format=]
 2078 |                  "%<#pragma once%> in main file");
      |                                  ^

$ /tmp/gb/./prev-gcc/xg++ -B/tmp/gb/./prev-gcc/ -v
Reading specs from /tmp/gb/./prev-gcc/specs
COLLECT_GCC=/tmp/gb/./prev-gcc/xg++
COLLECT_LTO_WRAPPER=/tmp/gb/./prev-gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20241009 (experimental) (GCC)
Comment 1 Mark Wielaard 2024-10-09 11:00:35 UTC
https://builder.sourceware.org/buildbot/#/changes/63248
"gcc, libcpp: Add warning switch for "#pragma once in main file" [PR89808]"
Fails bootstrap as above on arm64, amd64 and riscv.
Comment 2 Jakub Jelinek 2024-10-09 11:17:31 UTC
My https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662960.html patch hasn't been reviewed yet, with that it would just work, without it we need to (hopefully temporarily) use ' instead of %< and %>
Comment 3 Ken Matsui 2024-10-09 11:24:54 UTC
(In reply to Jakub Jelinek from comment #2)
> My https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662960.html
> patch hasn't been reviewed yet, with that it would just work, without it we
> need to (hopefully temporarily) use ' instead of %< and %>

I'll soon update the code to use ' instead for now, thank you.
Comment 4 GCC Commits 2024-10-09 11:35:04 UTC
The master branch has been updated by Ken Matsui <kmatsui@gcc.gnu.org>:

https://gcc.gnu.org/g:f709990333597b30dff54876bfdaada14e9cde30

commit r15-4199-gf709990333597b30dff54876bfdaada14e9cde30
Author: Ken Matsui <kmatsui@gcc.gnu.org>
Date:   Wed Oct 9 07:32:20 2024 -0400

    libcpp: Use ' instead of %< and %> [PR117039]
    
            PR bootstrap/117039
    
    libcpp/ChangeLog:
    
            * directives.cc (do_pragma_once): Use ' instead of %< and %>.
    
    Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
Comment 5 Ken Matsui 2024-10-09 11:38:54 UTC
Thank you for your report.  Addressed in https://gcc.gnu.org/g:f709990333597b30dff54876bfdaada14e9cde30.
Comment 6 Sergei Trofimovich 2024-10-09 21:22:20 UTC
The change fixed the build for my environment as well. Thank you!