You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clang on FreeBSD surfaces 156 instances of -Wpointer-sign across 9 files, all variations of implicit conversion between char * and u_char * / unsigned char *.
The codebase uses u_char * for DKIM/DNS data (which is correct — it's binary content) but passes these buffers to standard C string functions that expect char *, and vice versa. Clang treats char and unsigned char as distinct types and warns on implicit pointer conversions between them; gcc does not warn by default.
Fixes will likely be (char *) or (u_char *) casts at call sites, or changing buffer declarations to match the dominant usage in context. The right answer varies by site.
dkim.c:219-235 is likely a block of string literal initializers; those may want (const u_char *) casts or the receiving type changed.
This does not affect correctness on any current platform — char and unsigned char have the same representation and alignment — but it is noise that makes it harder to spot real warnings.
Clang on FreeBSD surfaces 156 instances of
-Wpointer-signacross 9 files, all variations of implicit conversion betweenchar *andu_char */unsigned char *.Affected files
libopendkim/dkim.c(many instances — string literals assigned toconst u_char *)libopendkim/dkim-keys.clibopendkim/dkim-mailparse.clibopendkim/dkim-report.clibopendkim/dkim-test.copendkim/opendkim.copendkim/opendkim-db.copendkim/opendkim-dns.copendkim/opendkim-testmsg.cPattern
The codebase uses
u_char *for DKIM/DNS data (which is correct — it's binary content) but passes these buffers to standard C string functions that expectchar *, and vice versa. Clang treatscharandunsigned charas distinct types and warns on implicit pointer conversions between them; gcc does not warn by default.Notes
-Wformat-truncationand-Wincompatible-pointer-typesis being addressed in Fix compiler warnings (-Wincompatible-pointer-types, -Wformat-truncation) #360. This is a separate, clang-specific (but also standards-correct) issue.(char *)or(u_char *)casts at call sites, or changing buffer declarations to match the dominant usage in context. The right answer varies by site.dkim.c:219-235is likely a block of string literal initializers; those may want(const u_char *)casts or the receiving type changed.charandunsigned charhave the same representation and alignment — but it is noise that makes it harder to spot real warnings.