C++ Logo

std-proposals

Advanced search

Re: [std-proposals] unimplemented attribute

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Tue, 18 Mar 2025 22:40:05 +0100
So the header marks a usage as dubious and the compiler outputs a warning diagnostics.   During linking it is decided, whether the symbol actually exists. Linking succeeds or fails, based on that?   Is this the gist of it?   And the attribute can exist for some translation units and not for others? Because others are sure about the existence?   -----Ursprüngliche Nachricht----- Von:Hans Åberg via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Di 18.03.2025 20:44 Betreff:Re: [std-proposals] unimplemented attribute An:marcinjaczewski86_at_[hidden]; CC:Hans Åberg <haberg_1_at_[hidden]>; std-proposals_at_[hidden]; > On 18 Mar 2025, at 20:23, Marcin Jaczewski <marcinjaczewski86_at_[hidden]> wrote: > > wt., 18 mar 2025 o 20:18 Hans Åberg <haberg_1_at_[hidden]> napisał(a): >> >>> On 18 Mar 2025, at 20:10, Marcin Jaczewski <marcinjaczewski86_at_[hidden]> wrote: >>> >>> Should this code compile or not? when exactly should it compiler and >>> when it should not? >> >> If it is a warning, it compiles with a diagnostic. But if you think it is safe, an error may be required. > > But this means this will not link, what point for warning as the whole > compilation fails? > If we have definitions when this warning is pointless as linking will > succeed and program will run. > Or do I miss something here? Because what you say is behavior of `[[obsolete]]`. If you only get a linker error, it may be tricker to find out what exactly is missing; a warning would tell that. With an error, one must handle the case when the definition is in a source file and the unimplemented directive in a header file, which must be overridden somehow if used in another source file. With a warning one gets a correct compile. -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2025-03-18 21:45:22