Merge attributesToCBuffer into functionToCBuffer2
Factor out safety and linkage printing