C++ Logo

sg15

Advanced search

Re: [isocpp-sg15] [P2758] Emitting messages at compile time

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Wed, 23 Oct 2024 11:56:30 +0100
On Wed, 23 Oct 2024 at 10:55, Ville Voutilainen <ville.voutilainen_at_[hidden]>
wrote:

> On Wed, 23 Oct 2024 at 12:01, Jonathan Wakely via SG15
> <sg15_at_[hidden]> wrote:
> > My use case for constexpr_print is for "interactive" development during
> compile-edit-debug cycles. You add some prints, but then take them out
> again once you've understood how the code is compiling. So IMHO it really
> doesn't matter how that output is displayed. It could even go to a separate
> file.
>
> Thanks, there's the answer to my pondering how the compiler could
> control the output of a constexpr_print.
>
> c++ -fconstexpr-print-output-file=-
> c++ -fconstexpr-print-output-file=myprintzlog.txt
>


Yeah, and that output could be completely disabled by default, if dumping
unstructured messages to a file/terminal is not a fit for the compiler's
typically high quality user experience. Document that you need to use
something like -fconstexpr-print-spew to enable those messages, but that
the output might be interleaved with the usual diagnostics and might not be
easily parsed by automated tooling.

There seem to be several ways to support this in *some* form without
compromising how compilers currently present output to users.

(I'm amused that Aaron said the only form he wants to support for Clang is
just print, no bells and whistles, but Corentin said the opposite and
suggested dropping the "just print" form, also for Clang :-)

Received on 2024-10-23 10:57:48