On 03.06.2025 00:00, Sergii Dmytruk wrote:
> On Mon, Jun 02, 2025 at 09:17:37AM +0200, Jan Beulich wrote:
>> On 23.05.2025 21:51, Sergii Dmytruk wrote:
>>> On Wed, May 21, 2025 at 05:19:57PM +0200, Jan Beulich wrote:
>>>>> +static inline uint64_t txt_bios_data_size(void *heap)
>>>>
>>>> Here, below, and in general: Please try to have code be const-correct, i.e.
>>>> use pointers-to-const wherever applicable.
>>>
>>> I assume this doesn't apply to functions returning `void *`.  The
>>> approach used in libc is to accept pointers-to-const but then cast the
>>> constness away for the return value, but this header isn't a widely-used
>>> code.
>>
>> Which is, from all I know, bad practice not only by my own view.
> 
> I actually ended up doing that to have const-correctness in v3.  In the
> absence of function overloads the casts have to be somewhere, can put
> them in the calling code instead.

Casts of which kind? For context: There shouldn't be any casting away of
const-ness (or volatile-ness, for the sake of completeness).

Jan

Reply via email to