Scripts that I used to write a blog post about section 7.24.1(2) of C11
Latest commit 9597fb2 Jul 1, 2016 @agl committed on GitHub Merge pull request #1 from jedisct1/patch-1
Update the blog post link

Testing the effects of section 7.24.1(2) of the C11 standard

This repository contains the scripts that I used to write a blog post about the assumption, in the C standard, that all pointers passed to standard library functions are non-NULL. It compiles a number of packages with and without this assumption and writes their disassembly to a text file.

If you wish to reproduce you need to do some setup because assumes that /usr/include/string.h.orig contains a pristine copy of /usr/include/string.h (with nonnull annotations) and that /usr/include/string.h.nullok contains a version of the same header but with the annotations removed. See string.h.patch for a diff from my computer of these files.

Once that's setup, you should ensure that you have passwordless sudo enabled, or else you'll be prompted for your password a few times. Otherwise, just running should produce a number of disas files in subdirectories of nonnull and nullok. (Note that it'll take a while to build all the packages. If you're only interested in a subset, comment out the others in the .sh file.)