Hello > The following lines that use the STRUCT_COPY macro are generating > build warnings. > > src/charset/ascii.c:792: warning: the address of 'base_set' will > always evaluate as 'true' (snip) > For example, the last line here is: > > STRUCT_COPY(return_encoding, &base_encoding); > > but base_encoding is declared just before that: static const ENCODING > base_encoding = {...} > > The PARROT_ASSERT in the macro against base_encoding is then > apparently superfluous.
I'v taken a look a those warnings some days ago. The macro STRUCT_COPY is generic and asserts his two parameter as non null, but is used in several places with arguments that the compiler knows is not, making the assertion redundant. But dropping the assertion will leave unchecked other usages. A possible solution is to add another macro taking as second argument the struct instead of a pointer. -- Salu2