Issue Details (XML | Word | Printable)

Key: PCC-61
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Mattias Pantzare
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
pcc

Include dir order not right

Created: 07/Jun/09 01:08 AM   Updated: 01/May/14 03:59 PM
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
The system include dir will be searched before the compiler include dir.

On OS X the system stdarg.h will not work with PCC, but the one provided with pcc will. But the default is to use the system stdarg.h.

Changing the order from:

av[na++] = "-S", av[na++] = altincdir;
av[na++] = "-S", av[na++] = incdir;
av[na++] = "-S", av[na++] = pccincdir;

to:

av[na++] = "-S", av[na++] = altincdir;
av[na++] = "-S", av[na++] = pccincdir;
av[na++] = "-S", av[na++] = incdir;

fixed the problem for me.

 All   Comments   Change History      Sort Order: Descending order - Click to sort in ascending order
Anders Magnusson added a comment - 01/May/14 03:59 PM
This seems to have been fixed in the time being.

Gregory McGarry added a comment - 08/Aug/09 12:24 PM
We could have include directories like this:

/usr/local/lib/pcc/powerpc-apple-darwin8.11.0/0.9.9/include/pre
/usr/include
/usr/local/lib/pcc/powerpc-apple-darwin8.11.0/0.9.9/include/post

We could use symlinks to ensure that some headers override the systems headers and other headers are available as default headers.

But I don't think we should make the behaviour different on different systems.

Anders Magnusson added a comment - 08/Aug/09 09:49 AM
Hm, would it make sense to have something like
#ifdef OSX
  include other way
#else
  include as always
#endif

??

Gregory McGarry added a comment - 09/Jun/09 01:53 PM - edited
The current behaviour is correct. The current order is:

/usr/local/include/pcc
/usr/include
/usr/local/lib/pcc/powerpc-apple-darwin8.11.0/0.9.9/include/

It's impossible to design headers which will work on all operating systems. stddef.h is a particular problem. The libpcc headers are for systems which don't provide them. For systems which provide broken headers, then they have to be modified and placed in /usr/local/include/pcc to override the system headers.

I know that OS X mostly works okay with the include path order reversed. But it's not true on most of the other systems.

Maybe one day there will be a fixincludes script which can correctly merge the system headers with libpcc headers.

Anders Magnusson added a comment - 07/Jun/09 01:55 PM
Sounds sane from my POV, but I don't know side effects on other OSes. Greg?