I'm now using Xcode 14.2 (14C18) and I'd like to the documentation features working again.
The integrated documentation used to work in Xcode 13, but sporadically stopped working when I upgraded to Xcode 14.
I recently noticed that there is now an explicit Product > Build Documentation command. When I run that, I get a bunch of failures. (Note that this is a large project with many targets, all of which build and archive OK.)
The problem seems to be that all of the files (specifically some .h files) are getting compiled/scanned separately. Even ones that aren't included anywhere (for historical reasons).
So I end up with failures for lines like this one:
#error class unimplemented /* the sockets interface was never used */
This error doesn't occur during regular compilation, because the .m file that includes it is not included in any targets.
Now some of these I could clean up, but the next error has me completely stumped.
I have a simple "version.h" file that defines the following symbols:
#define PRODVERSION_MAJOR 3
#define PRODVERSION_MINOR 0
#define PRODVERSION_FIX 0
#define PRODVERSION_BUILD 73
#define PRODVERSION_NUMERIC 3.0.0.73
The last line fails with the error "invalid suffix .0.73 on floating constant"
Which makes me think that the preprocessor used by the document compiler is trying to interpret this symbol as a floating point number and failing.
So is there away around this?
I'm specifically wondering if there are preprocessor symbols defined by the documentation compiler that can be used (i.e. #ifndef __DocC__
...) to exclude code from the documentation build.