On 2026-02-14T20:08:06+0100, Alejandro Colomar wrote:
> Hi Paul,
> 
> On 2026-02-14T10:50:42-0800, Paul Eggert wrote:
> > On 2026-02-14 10:07, Alejandro Colomar wrote:
> > > On 2026-02-14T09:43:47-0800, Paul Eggert wrote:
> > > > It's OK for a reproducible function's body to contain a
> > > > call to a function not marked reproducible, so long as the call is never
> > > > executed....
> > > > This can happen when, for example, there's a debugging flag set at
> > > > compile-time, and the flag is off so the compiler can easily determine 
> > > > the
> > > > call cannot happen.
> > > 
> > > If you mean code that is stripped out by the preprocessor, it wouldn't
> > > be a problem.
> > No, I mean code that survives the preprocessor, but evaluates to 'false' at
> > compile time. This is a common idiom, and it's often better than using the
> > preprocessor.
> 
> Is this soved by alx-0087r5?  Or could you show an example to analyze?

If you mean something like

        if (0) {
                f();
        }

we can't allow that, because that would require path analysis to be able
to determine whether f() is evaluated or not.  Consider for example this
code:

        goto x;
        if (0) {
x:              f();
        }

So we need to disallow that.  It would be up to you to silence the
diagnostic manually if you know that's fine.


Cheers,
Alex

-- 
<https://www.alejandro-colomar.es>

Attachment: signature.asc
Description: PGP signature

Reply via email to