Some libraries, like GTK+ and glibc, assume the use of headers for the version targetted. In other words, even if the "Since 2.4" functions are avoided, if it is compiled against the GTK+ 2.4 headers there is a risk of gaining an implicit dependency on GTK+ 2.4.
The only current solution to this is to get a copy of the older headers for the version targetted and drop them into the apbuild directory so they are searched before your system headers are.
In particular, this affects the g_return_if_fail macro in glib, the ctype functions in glibc, the GDK_THREADS_ENTER/EXIT macros in GDK, and pthread_cleanup_push/pop.