Hello Bruno, (please use this email address, here) On Sun, 19 Jan 2025 10:58:31 +0100, Bruno Haible wrote:
> Also noteworthy is that in section 1 of this paper, the motivation > is to make REPRODUCIBLE equivalent to PURE, and UNSEQUENCED > equivalent to CONST, but the proposed changes in section 3 address > only one of the two differences between REPRODUCIBLE/UNSEQUENCED and > PURE/CONST. Even with the proposed change, > - A function with UNSEQUENCED can depend on the state addressed by > its arguments, while a function with CONST cannot. My understanding was that const-attribute-functions basically cannot have pointer paramters? This part is meant as an extension of the gnu attribute. But to be honest it is quite difficult to guess this kind of properties of the gnu attribute from the scarce documentation of the feature. > - A function with REPRODUCIBLE can affect state addressed by its > arguments, while a function with PURE cannot. I don't think that this one is really a semantical difference either. The gnu attribute has the weird property that pointed-to objects by parameters are as-if `const`-qualified. (At least that is what I got from the almost non-existing documentation of the feature.) I don't see a reason why this would not be imposed by a constraint. This is nothing we would ever standardize in C, I think, `const`-qualification is there for a reason, and such properties that form a binding contract should be reflected in the interface whenever this is possible. So the way forward here would perhaps that gcc starts warning about parameters where pointer targets are not `const`-qualified? If then gcc would only accept `const`-qualified targets, then here also `[[reproducible]]` would be and extension of attribute-const, with a clear semantic. Thanks Jₑₙₛ -- :: ICube :::::::::::::::::::::::::::::: deputy director :: :: Université de Strasbourg :::::::::::::::::::::: ICPS :: :: INRIA antenne de Strasbourg :::::::::::::::::: Camus :: :: INRIA PIQ program Strasbourg :::::::::: piq.inria.fr :: :: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 :: :: https://icube-icps.unistra.fr/index.php/Jens_Gustedt ::