Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Ignorance is the soil in which belief in miracles grows." -- Robert G. Ingersoll


devel / comp.std.c / What is the point of restrict in fopen?

SubjectAuthor
* What is the point of restrict in fopen?Kaz Kylheku
`* Re: What is the point of restrict in fopen?Tim Rentsch
 `* Re: What is the point of restrict in fopen?Jakob Bohm
  +* Re: What is the point of restrict in fopen?Kaz Kylheku
  |`* Re: What is the point of restrict in fopen?Tim Rentsch
  | `* Re: What is the point of restrict in fopen?Kaz Kylheku
  |  `- Re: What is the point of restrict in fopen?Tim Rentsch
  `- Re: What is the point of restrict in fopen?Tim Rentsch

1
What is the point of restrict in fopen?

<20230524162836.172@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=506&group=comp.std.c#506

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.std.c
Subject: What is the point of restrict in fopen?
Date: Wed, 24 May 2023 23:41:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <20230524162836.172@kylheku.com>
Injection-Date: Wed, 24 May 2023 23:41:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7264def4292440fe77c5eb5cb5f8c794";
logging-data="3309014"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sgj3pGLMeP6rGTO/OeXX3mRh8J48nCFc="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:UttXX2DKtjIRb8XUUWChICt0Bvo=
 by: Kaz Kylheku - Wed, 24 May 2023 23:41 UTC

I've noticed that both arguments of fopen are restrict-qualified.

What does this achieve?

If I have:

const char *path = "foobar";
const char *mode = path + 6;

FILE *f = fopen(path, mode);

is the behavior undefined, since the mode pointer accesses
something which is also accessed through path?

What if the code is this:

FILE *f = fopen("foobar", "r");

and the compiler itself merges the two string literals so
that they share storage?

The arguments are treated as immutable by fopen, so what is
the purpose of restrict?

The benefit of restrict is that when an object is being modified through
a restrict-qualified pointer, the implementation is not required to care
whether the object is aliased through another object. Access through the
other pointer can be cached as if that modification didn't happen.
If aliasing is occurring, the behavior is undefined, allowing the
implementor not to care about that situation.

But the arguments to fopen must not be modified.

How can fopen be made faster based on the assurance that the inputs do
not overlap, (and is that really worth breaking programs?)

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: What is the point of restrict in fopen?

<86cz0mzemm.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=520&group=comp.std.c#520

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.std.c
Subject: Re: What is the point of restrict in fopen?
Date: Thu, 20 Jul 2023 10:17:37 -0700
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <86cz0mzemm.fsf@linuxsc.com>
References: <20230524162836.172@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="3857442d865f8a7bff3454fde02b814b";
logging-data="2949588"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4um90phf1QarLebHlc+r5jsWOhcg1l3A="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:qqIIgbXoeRmJs+9CcxqjY9tD1A8=
sha1:cJXpqmJYWqVAILavJuv2wYSiGL0=
 by: Tim Rentsch - Thu, 20 Jul 2023 17:17 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:

> I've noticed that both arguments of fopen are restrict-qualified.

What I think you mean is that the arguments given in the prototype
declaration in the C standard are qualified with the 'restrict'
keyword.

Note that this form of declaration has no effect on the semantics of
the function. The function declaration, and its semantics, are just
the same as if the uses of 'restrict' were removed.

Re: What is the point of restrict in fopen?

<9x2cnQDaqOkRtyf5nZ2dnZeNn_di4p2d@giganews.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=525&group=comp.std.c#525

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!69.80.99.22.MISMATCH!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 21 Jul 2023 06:49:48 +0000
Subject: Re: What is the point of restrict in fopen?
Newsgroups: comp.std.c
References: <20230524162836.172@kylheku.com> <86cz0mzemm.fsf@linuxsc.com>
From: jb-use...@wisemo.com.invalid (Jakob Bohm)
Organization: WiseMo A/S
Date: Fri, 21 Jul 2023 08:55:48 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:6.2) Goanna/20230604 Epyrus/2.0.2
MIME-Version: 1.0
In-Reply-To: <86cz0mzemm.fsf@linuxsc.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Message-ID: <9x2cnQDaqOkRtyf5nZ2dnZeNn_di4p2d@giganews.com>
Lines: 27
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-owytv4faIXZRGt0yKbXAH5h7MeDXoA+emBJ0TLDqS11ehyjUBEErPt7HTKZC9GpvdR/av4jnpe914nN!6QpRwrphYb+D1OHpDDp1K5i3vhPXyz6wITXVjiioh+LU+ldah4L7lz2PjBiC3LGOFyRpq8PApzA=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Jakob Bohm - Fri, 21 Jul 2023 06:55 UTC

On 2023-07-20 19:17, Tim Rentsch wrote:
> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>
>> I've noticed that both arguments of fopen are restrict-qualified.
>
> What I think you mean is that the arguments given in the prototype
> declaration in the C standard are qualified with the 'restrict'
> keyword.
>
> Note that this form of declaration has no effect on the semantics of
> the function. The function declaration, and its semantics, are just
> the same as if the uses of 'restrict' were removed.
>

Note that Tim's critique or restrict in May 2023 is very similar to the
critique of the similar noalias proposal in messageid <7753@alice.UUCP>
by someone highly respected in this group. That was posted 35 years
ago.

Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S. https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark. Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded

Re: What is the point of restrict in fopen?

<20230721215906.639@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=532&group=comp.std.c#532

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.std.c
Subject: Re: What is the point of restrict in fopen?
Date: Sat, 22 Jul 2023 05:37:15 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 87
Message-ID: <20230721215906.639@kylheku.com>
References: <20230524162836.172@kylheku.com> <86cz0mzemm.fsf@linuxsc.com>
<9x2cnQDaqOkRtyf5nZ2dnZeNn_di4p2d@giganews.com>
Injection-Date: Sat, 22 Jul 2023 05:37:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b30b716b22f4706121b4a047272243a6";
logging-data="3900032"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HD3A5guPLDk0Kx3R3NRBvcuwsV43PaGU="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:rUNjwLDqbYXfqivXWDlntDfqVvs=
 by: Kaz Kylheku - Sat, 22 Jul 2023 05:37 UTC

On 2023-07-21, Jakob Bohm <jb-usenet@wisemo.com.invalid> wrote:
> On 2023-07-20 19:17, Tim Rentsch wrote:
>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>
>>> I've noticed that both arguments of fopen are restrict-qualified.
>>
>> What I think you mean is that the arguments given in the prototype
>> declaration in the C standard are qualified with the 'restrict'
>> keyword.
>>
>> Note that this form of declaration has no effect on the semantics of
>> the function. The function declaration, and its semantics, are just
>> the same as if the uses of 'restrict' were removed.
>>
>
> Note that Tim's critique or restrict in May 2023 is very similar to the
> critique of the similar noalias proposal in messageid <7753@alice.UUCP>
> by someone highly respected in this group. That was posted 35 years
> ago.

That someone was even opposed to const, for some good reasons.

The present issue reveals a design flaw in the C type system:
that qualifiers on function parameters don't matter.

They should, though.

void f(const int);
void f(int);

should be incomaptible and diagnosed! Someone thought, at some point, that
those qualifiers which existed then (const, volatile) only affect the
function definition locally, and not its interface semantics.

So, it probably seemed like a marvellous idea. I know! Let's make
qualifiers on parameters not matter, as if they were not there.
Then you can make a parameter const, if that makes sense in
the function definition, without disturbing the declaration.

But restrict is not like this. When a pointer parameter is restrict, it
changes the semantics in a way that is very much relevant to the caller.

Here is how it should work:

The rule should be that only const and volatile qualifiers do not matter
on a function parameter, as far as type compatibility and composite type
is concerned. The restrict qualifier should matter, and future
qualifiers that may be introduced have to be considered on a
case-by-casde basis.

If a function definition is changed to include a restrict parameter,
that should render it incompatible with the declaration.

The declaration is then updated, and makes a semantic difference to the
calls; the calls become undefined behavior if they pass overlapping
objects. This can be detected at translation time and diagnosed, with
the translation unit then being rejected, even if all that is known bout
the function is its declaration with restrict parameters.

Alternative rules:

// All declarations must be identical in restrict qualification:

int f(const char * restrict);
int f(const char *); // error: incompatible redeclaration

// Definition is allowed to change restrict qualification

int f(const char *p) // OK
{
// type of f here is without the restrict.
// Only the parameter itself lacks the qualifier.
// If f recurses, restrict does not apply to call.
}

// type of f in this scope is *with* the restrict from decl.

In other words, the type doesn't compose with regard to restrict
qualification. Only a definition can change the restrict-qualification
of a parameter, and then in taht definition's own scope, its own
restrict qualifiers (or lack thereof) apply, and determine the type of
the function, not only the local parameters.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: What is the point of restrict in fopen?

<86lef4rwx9.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=536&group=comp.std.c#536

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.std.c
Subject: Re: What is the point of restrict in fopen?
Date: Tue, 25 Jul 2023 05:35:30 -0700
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <86lef4rwx9.fsf@linuxsc.com>
References: <20230524162836.172@kylheku.com> <86cz0mzemm.fsf@linuxsc.com> <9x2cnQDaqOkRtyf5nZ2dnZeNn_di4p2d@giganews.com> <20230721215906.639@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="25cc9caf93cbb682b63b59729477b86a";
logging-data="1184604"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7PUpRai3Dd+ziWtAc87ofcDy8irKDRqk="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:VdkiY+SjQ1lYfs07v7u6vTcGNVQ=
sha1:qSF2I3F8Wmr4O8A+8gC+IVqUUpM=
 by: Tim Rentsch - Tue, 25 Jul 2023 12:35 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:

> On 2023-07-21, Jakob Bohm <jb-usenet@wisemo.com.invalid> wrote:
>
>> On 2023-07-20 19:17, Tim Rentsch wrote:
>>
>>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>>
>>>> I've noticed that both arguments of fopen are restrict-qualified.
>>>
>>> What I think you mean is that the arguments given in the prototype
>>> declaration in the C standard are qualified with the 'restrict'
>>> keyword.
>>>
>>> Note that this form of declaration has no effect on the semantics
>>> of the function. The function declaration, and its semantics, are
>>> just the same as if the uses of 'restrict' were removed.
>>
>> Note that Tim's critique or restrict in May 2023 is very similar
>> to the critique of the similar noalias proposal in messageid
>> <7753@alice.UUCP> by someone highly respected in this group.
>> That was posted 35 years ago.
>
> That someone was even opposed to const, for some good reasons.
>
> The present issue reveals a design flaw in the C type system:
> that qualifiers on function parameters don't matter.
>
> They should, though.
>
> void f(const int);
> void f(int);
>
> should be incomaptible and diagnosed!

A foolish consistency is the hobgoblin of little minds.

Re: What is the point of restrict in fopen?

<86h6psrwu5.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=537&group=comp.std.c#537

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.std.c
Subject: Re: What is the point of restrict in fopen?
Date: Tue, 25 Jul 2023 05:37:22 -0700
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <86h6psrwu5.fsf@linuxsc.com>
References: <20230524162836.172@kylheku.com> <86cz0mzemm.fsf@linuxsc.com> <9x2cnQDaqOkRtyf5nZ2dnZeNn_di4p2d@giganews.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="25cc9caf93cbb682b63b59729477b86a";
logging-data="1184604"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/oDsxbtXaSaV4tNsE5zHMP/QoZis90dbo="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:E7OaobIHLAkBOaYwPApnklBJ6T0=
sha1:FdOp+TfNyE239quA1nmnWV/oLzs=
 by: Tim Rentsch - Tue, 25 Jul 2023 12:37 UTC

Jakob Bohm <jb-usenet@wisemo.com.invalid> writes:

> On 2023-07-20 19:17, Tim Rentsch wrote:
>
>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>
>>> I've noticed that both arguments of fopen are restrict-qualified.
>>
>> What I think you mean is that the arguments given in the prototype
>> declaration in the C standard are qualified with the 'restrict'
>> keyword.
>>
>> Note that this form of declaration has no effect on the semantics
>> of the function. The function declaration, and its semantics, are
>> just the same as if the uses of 'restrict' were removed.
>
> Note that Tim's critique or restrict in May 2023 is very similar
> to the critique of the similar noalias proposal in messageid
> <7753@alice.UUCP> [...]

My comment wasn't a critique, just an observation.

Re: What is the point of restrict in fopen?

<20230725120541.589@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=538&group=comp.std.c#538

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.std.c
Subject: Re: What is the point of restrict in fopen?
Date: Tue, 25 Jul 2023 19:33:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 89
Message-ID: <20230725120541.589@kylheku.com>
References: <20230524162836.172@kylheku.com> <86cz0mzemm.fsf@linuxsc.com>
<9x2cnQDaqOkRtyf5nZ2dnZeNn_di4p2d@giganews.com>
<20230721215906.639@kylheku.com> <86lef4rwx9.fsf@linuxsc.com>
Injection-Date: Tue, 25 Jul 2023 19:33:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0f2a2d01c18a06e64c17c6f7ab47d376";
logging-data="1272543"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QkE+oSGKV3vDkskSnhkoRJRlhGrGGnTA="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:ViGbsv8tBOkzVMlXxec+01W1W8M=
 by: Kaz Kylheku - Tue, 25 Jul 2023 19:33 UTC

On 2023-07-25, Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>
>> On 2023-07-21, Jakob Bohm <jb-usenet@wisemo.com.invalid> wrote:
>>
>>> On 2023-07-20 19:17, Tim Rentsch wrote:
>>>
>>>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>>>
>>>>> I've noticed that both arguments of fopen are restrict-qualified.
>>>>
>>>> What I think you mean is that the arguments given in the prototype
>>>> declaration in the C standard are qualified with the 'restrict'
>>>> keyword.
>>>>
>>>> Note that this form of declaration has no effect on the semantics
>>>> of the function. The function declaration, and its semantics, are
>>>> just the same as if the uses of 'restrict' were removed.
>>>
>>> Note that Tim's critique or restrict in May 2023 is very similar
>>> to the critique of the similar noalias proposal in messageid
>>> <7753@alice.UUCP> by someone highly respected in this group.
>>> That was posted 35 years ago.
>>
>> That someone was even opposed to const, for some good reasons.
>>
>> The present issue reveals a design flaw in the C type system:
>> that qualifiers on function parameters don't matter.
>>
>> They should, though.
>>
>> void f(const int);
>> void f(int);
>>
>> should be incomaptible and diagnosed!
>
> A foolish consistency is the hobgoblin of little minds.

I deserve that for starting with that silly bait,
but I later acknowledged that the flexibility is necessary
to be able to const-qualify a parameter in the definition
without touching the declaration.

Here is a realistic plan.

Phase 1:

Qualifiers except restrict are ignored in function
declarators, are not part of the function type and do not
participate in composition. The restrict qualifier is now
part of the type. If a declaration restrict-qualifies a parameter, a
redeclaration (or definition) need not. The composite type of the
parameter will be restrict-qualified.

Tolerance for the presence of const and volatile qualifiers on
paramaters in prototype declarations is marked obsolescent.

Phase 2:

The obsolescence period introduced in Phasae 1 ends. Const and volatile
qualifiers are no longer allowed on parameters in declarations; it is a
diagnosable constraint violation. They are allowed in definitions only,
and don't contribute to the function type declared.

A new obsolescence period begins: situations in which multiple
declarations of a function differ in the restrict-qualification of a
parameter are considered obsolescent.

Phase 3:

Obsolescence period from Phase 2 ends: it is a constraint violation
whenever a declaration or definition of a function differs
from a previous declaration in the restrict qualification of
a parameter.

// Phase 1 Phase 2 Phase 3
void f(const int); // obsol. error error
//
void f(char *restrict p); //
void g(char *); //
//
void f(char *p) { } // obsol. error
void g(char *restrict p) // obsol. error

i.e. the language becomes sane. Bullshit code smells like qualifiers
that do nothing become errors. If restrict is used to optimize a
function in a way that affects the interface contract, that must be
reflected in the declaration; it is not possible to use restrict
in a definition, but omit that in a declaration.

Re: What is the point of restrict in fopen?

<86sf8yface.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=546&group=comp.std.c#546

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.std.c
Subject: Re: What is the point of restrict in fopen?
Date: Fri, 04 Aug 2023 20:15:45 -0700
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <86sf8yface.fsf@linuxsc.com>
References: <20230524162836.172@kylheku.com> <86cz0mzemm.fsf@linuxsc.com> <9x2cnQDaqOkRtyf5nZ2dnZeNn_di4p2d@giganews.com> <20230721215906.639@kylheku.com> <86lef4rwx9.fsf@linuxsc.com> <20230725120541.589@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="943f511331d2b471aa1b6ebff38979e9";
logging-data="1709797"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mG2CrPMlyh6jkmuR8DpRNS9TVSuS9Y8Y="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:AvnI/wYf7I3mL7UnpqtZwCKz7HQ=
sha1:SpY66//jfL0HkcEtrgdi9DFEwNI=
 by: Tim Rentsch - Sat, 5 Aug 2023 03:15 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:

> On 2023-07-25, Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
>
>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>
>>> On 2023-07-21, Jakob Bohm <jb-usenet@wisemo.com.invalid> wrote:
>>>
>>>> On 2023-07-20 19:17, Tim Rentsch wrote:
>>>>
>>>>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>>>>
>>>>>> I've noticed that both arguments of fopen are
>>>>>> restrict-qualified.
>>>>>
>>>>> What I think you mean is that the arguments given in the
>>>>> prototype declaration in the C standard are qualified with
>>>>> the 'restrict' keyword.
>>>>>
>>>>> Note that this form of declaration has no effect on the
>>>>> semantics of the function. The function declaration, and its
>>>>> semantics, are just the same as if the uses of 'restrict'
>>>>> were removed.

[...]

> Here is a realistic plan.
>
> Phase 1:
>
> [...]
>
> Phase 2:
>
> [...]
>
> Phase 3:
>
> [...]

Here is a simpler and better idea.

Add a Recommended Practice that compilers provide an
option to produce a diagnostic when a function
parameter is restrict-qualified in the function
definition but is not restrict-qualified in any other
declaration of the function in the same compilation
unit.

And nothing more than that.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor