On Tue, Apr 01, 2025 at 05:13:46PM -0700, Bill Wendling wrote:
> On Tue, Apr 1, 2025 at 8:29 AM Martin Uecker <uec...@tugraz.at> wrote:
> > Am Dienstag, dem 01.04.2025 um 15:01 +0000 schrieb Qing Zhao:
> > > > On Apr 1, 2025, at 10:04, Martin Uecker <uec...@tugraz.at> wrote:
> > > > Am Montag, dem 31.03.2025 um 13:59 -0700 schrieb Bill Wendling:
> > > > > > I'd like to offer up this to solve the issues we're facing. This is 
> > > > > > a
> > > > > > combination of everything that's been discussed here (or at least 
> > > > > > that
> > > > > > I've been able to read in the centi-thread :-).
> > > >
> > > > Thanks! I think this proposal much better as it avoids undue burden
> > > > on parsers, but it does not address all my concerns.
> > > >
> > > >
> > > > From my side, the issue about compromising the scoping rules of C
> > > > is also about unintended non-local effects of code changes. In
> > > > my opinion, a change in a library header elsewhere should not cause
> > > > code in a local scope (which itself might also come from a macro) to
> > > > emit a warning or require a programmer to add a workaround. So I am
> > > > not convinced that adding warnings or a workaround such as
> > > > __builtin_global_ref  is a good solution.
> 
> To clarify, I'm not in favor of adding a generalized new scoping rule
> to C, but only for identifiers in attributes. From what I've seen in

There are existing attributes which support general expressions in their
arguments, e.g. the assume attribute, OpenMP attributes etc.  Those definitely
shouldn't change behavior if some new behavior for identifier lookup in 
attributes
is added.
Many others do support identifiers as their arguments (e.g. mode attribute,
2 argument malloc attribute, ...).  Those can't change behavior either.

I think using either a predefined identifier or self-declared one is the
only reasonable way to go (whether it represents something like this pointer
in C++ or in the latter case possibly forward declaration of the member), 
otherwise
it will be hard to understand for users and very much error prone.

        Jakub

Reply via email to