C++ Logo

sg15

Advanced search

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

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Mon, 28 Oct 2024 17:43:59 +0000
[Boris]
> Sure, though I don't think this is a novel problem: you can already
> easily achieve such non-determinism with the __DATE__/__TIME__ macros.

Sorry, I don't follow.

The __DATE__ and __TIME__ non-determinism issue is solved not by the build systems directly, but by compilers offering options.
Are you equating the non-determinism of __DATE__/__FILE__ with that of what we are discussing here? If so, how does that work?

-- Gaby

-----Original Message-----
From: Boris Kolpackov <boris_at_[hidden]>
Sent: Monday, October 28, 2024 12:52 AM
To: Gabriel Dos Reis <gdr_at_[hidden]>
Cc: Gabriel Dos Reis via SG15 <sg15_at_[hidden]>
Subject: Re: [isocpp-sg15] [P2758] Emitting messages at compile time

Gabriel Dos Reis <gdr_at_[hidden]> writes:

> If the generated code is using some intermediary file that the compiler
> can surface to the build system, that would work. My concern though is
> around code generation at compile time that does not use any intermediary
> file surfaced to the build system. If that process is not deterministic
> (because of arbitrary side effects) then, I think we have a problem with
> how build systems work today. Do you agree?

Sure, though I don't think this is a novel problem: you can already
easily achieve such non-determinism with the __DATE__/__TIME__ macros.
I don't know of any build system that cares to handle such cases (beyond
the "don't do this if you want deterministic/reproducible builds" advice
to the user). And I don't believe this will change.

Received on 2024-10-28 17:44:03