#37601: libc-headers installs stdio.h masking OS libc header ---------------------------+---------------------- Reporter: ciserlohn@… | Owner: mfeiri@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: libc-headers | ---------------------------+---------------------- Comment (by mfeiri@…): I was unable to reproduce this error on my 10.8 machine. But based on your description I assume that this is indeed a case of preprocessor header mixup. I guess you have at least three cdefs.h files on your machine * /usr/include/ * /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/sys/cdefs.h * /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/sys/cdefs.h In your case the 10.7 version of stdio.h from libc-headers collided with the 10.8 version of cdefs.h from the MacOSX10.8.sdk. Targeting an SDK that does not match the host OS is more like cross compiling. MacPorts should, just like /usr/include/, stay out of such a cross compilation. The reason why MacPorts headers interfere, while the /usr/include headers don't, is likely because we use CPATH to give MacPorts precedence over other includes. I guess I need to find a way to avoid this when targeting a non- local SDK for "cross" compilation. And I need to commit the xnu-headers port to provide cdefs.h in MacPorts and make sure that the xnu-headers are always installed when libc-headers are present to avoid partial shadowing. -- Ticket URL: <https://trac.macports.org/ticket/37601#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS