Bug 298252 - System include path not initialized
Summary: System include path not initialized
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 4.3.0
Platform: unspecified FreeBSD
: NOR normal
Target Milestone: 4.3.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-16 15:33 UTC by Luca Pizzamiglio
Modified: 2012-04-17 16:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
This should fix the problem, using a compatible command line (600 bytes, patch)
2012-04-16 15:37 UTC, Luca Pizzamiglio
Details
fallback to gcc-call without -std=cpp0x argument in case of error (3.39 KB, patch)
2012-04-17 08:28 UTC, Milian Wolff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Pizzamiglio 2012-04-16 15:33:20 UTC
The system include path is not correctly initialized.
The problem is that old gcc's (like 4.2.1 used on FreeBSD) has no -std option. 
gcc with that option return an error code and the output parsing doesn't happen

Reproducible: Always

Steps to Reproduce:
1. Launch KDevelop on FreeBSD
2. open a source file and system includes are not recognized
3.
Comment 1 Luca Pizzamiglio 2012-04-16 15:37:58 UTC
Created attachment 70432 [details]
This should fix the problem, using a compatible command line

This patch should fix the problem. Tested on my system (FreeBSD8)
Removing the -std=c++0x option shouldn't affect the output using newer version of gcc (tested with gcc 4.6)
Comment 2 Milian Wolff 2012-04-16 21:58:24 UTC
hm while this will fix the include files, isn't the macro-getter in computeGccStandardMacros still broken then for these old gcc's?

I'm thinking on making this a compile-time option... would that be OK for you?
Comment 3 Luca Pizzamiglio 2012-04-16 22:37:15 UTC
ops, I didn't see the same definition on computeGccStandardMacros()...

a compile-time options should work!
Comment 4 Milian Wolff 2012-04-17 08:28:59 UTC
Created attachment 70446 [details]
fallback to gcc-call without -std=cpp0x argument in case of error

please try this patch, does that work for you? it will first run gcc with -std=c++0x and then fallback to a version without that argument in case of error. that should be better than a compile-time check since it's something we need to know at runtime.
Comment 5 Luca Pizzamiglio 2012-04-17 08:56:30 UTC
I'm using it and includes and defines are correctly detected.
I agree, a run-time check is preferable.

thanks for the fast answer!
Comment 6 Milian Wolff 2012-04-17 09:17:50 UTC
Git commit 5799abe3b73b5ee1cfda275e463529d47f35e77f by Milian Wolff.
Committed on 17/04/2012 at 11:14.
Pushed by mwolff into branch '4.3'.

Fix gcc include-path and macro computation on machines with old GCC.

Whe default to calling GCC with -std=c++0x and fallback to a call
without that argument when the former fails.

M  +3    -2    languages/cpp/setuphelpers.cpp
M  +25   -4    languages/cpp/setuphelpers_gcc.cpp

http://commits.kde.org/kdevelop/5799abe3b73b5ee1cfda275e463529d47f35e77f
Comment 7 Milian Wolff 2012-04-17 16:15:57 UTC
Git commit 6b95b832d72696df0278ac7b9d290c96b798ef07 by Milian Wolff.
Committed on 17/04/2012 at 11:14.
Pushed by mwolff into branch '4.3'.

Fix gcc include-path and macro computation on machines with old GCC.

Whe default to calling GCC with -std=c++0x and fallback to a call
without that argument when the former fails.

M  +3    -2    languages/cpp/setuphelpers.cpp
M  +25   -4    languages/cpp/setuphelpers_gcc.cpp

http://commits.kde.org/kdevelop/6b95b832d72696df0278ac7b9d290c96b798ef07