Lines 82 and 93 of the example code (mypci.c) should use the %zd format string instead of %d. Otherwise the code fails on 64bit arch.
I updated the documentation, it should be available on the website within 24 hours. Thanks!
A commit references this bug: Author: trhodes Date: Mon Mar 11 15:12:25 UTC 2019 New revision: 52856 URL: https://svnweb.freebsd.org/changeset/doc/52856 Log: Use %zd as the format string. The previous, %d, is not ssize_t and breaks the mypci.c build. PR: 215863 Changes: head/en_US.ISO8859-1/books/arch-handbook/pci/chapter.xml