[fpc-devel] alignment warnings

Henry Vermaak henry.vermaak at gmail.com
Fri Sep 30 11:44:52 CEST 2011


Hi list

Thinking more about the alignment problems on arm and elsewhere, I was 
wondering how hard it would be to implement something like gcc's 
-Wcast-align.  Here's a description from the man page:

Warn whenever a pointer is cast such that the required alignment of the 
target is increased.  For example, warn if a "char *" is cast to an "int 
*" on machines where integers can only be accessed at two- or four-byte 
boundaries.

This would really help to catch problematic code before things get out 
of hand and you have to wait for segfault/sigbus before you know where 
the problems are.

Henry



More information about the fpc-devel mailing list