diff options
author | David Mitchell <davem@iabyn.com> | 2009-03-29 22:03:13 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2009-03-29 22:32:18 +0100 |
commit | cf3f0ffbff208944549640df283e3008d1b83d77 (patch) | |
tree | 9b9a0185a339a7619a678e8a4bccc65ee9e57608 /handy.h | |
parent | 2a8f410418d535022b9d9c826afce2be4b335b47 (diff) | |
download | perl-cf3f0ffbff208944549640df283e3008d1b83d77.tar.gz |
provide minimal documentation for the MUTABLE_*() macros
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -48,6 +48,15 @@ Null SV pointer. (No longer available when C<PERL_CORE> is defined.) #define TRUE (1) #define FALSE (0) +/* The MUTABLE_*() macros cast pointers to the types shown, in such a way + * (compiler permitting) that casting away const-ness will give a warning; + * e.g.: + * + * const SV *sv = ...; + * AV *av1 = (AV*)sv; <== BAD: the const has been silently cast away + * AV *av2 = MUTABLE_AV(sv); <== GOOD: it may warn + */ + #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) # define MUTABLE_PTR(p) ({ void *_p = (p); _p; }) #else |