From da9483aa3a41256bfe491782b84c0af4059818ed Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Tue, 22 May 2018 19:38:38 +0200 Subject: [PATCH] Add reference to C standard about CONST_CAST. --- m-core.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/m-core.h b/m-core.h index a84083ac..ee369385 100644 --- a/m-core.h +++ b/m-core.h @@ -1246,9 +1246,10 @@ /* Cast 'n' of type 'type*' into 'const type*'. This is like (const type*)p but safer as the type of 'n' is checked, and more robust for double arrays type. - NOTE: Not sure if it is 100% compliant with the C standard, but - I can't find a working implementation (or even a theorical one) - where it fails. + NOTE: Seems to be compliant with the C standard as in ยง6.2.5 Types: + "Similarly, pointers to qualified or unqualified versions + of compatible types shall have the same representation and + alignment requirements." */ #ifndef __cplusplus # define M_CONST_CAST(type, n) \