GNU bug report logs - #31198
25.1; Semantic fails to find system include (header) files

Previous Next

Package: emacs;

Reported by: johol <at> lysator.liu.se

Date: Tue, 17 Apr 2018 15:00:01 UTC

Severity: normal

Found in version 25.1

To reply to this bug, email your comments to 31198 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31198; Package emacs. (Tue, 17 Apr 2018 15:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to johol <at> lysator.liu.se:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 17 Apr 2018 15:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: johol <at> lysator.liu.se
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; Semantic fails to find system include (header) files
Date: Tue, 17 Apr 2018 10:00:30 +0000
GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.18.9)
System Description: CentOS release 6.4 (Final)


Summary
=======

Semantic fails to locate C/C++ system header files when a system  
header file in turn uses double quotes instead of angle brackets in  
include statements.


Example
=======

Assume the trivial C++ source file Foo.cpp that just contains a single  
include statement

---- 8< -----
#include <QFile>
---- 8< -----

The system include path for the ede-cpp-project points to the  
directory /usr/include and Semantic is able to properly locate the  
QFile header in /usr/include/QtCore/.

However, the header file /usr/include/QtCore/QFile contains only a  
single include statement that points to the file qfile.h. This include  
statement uses double quotes instead of angle brackets, i.e. the  
contents of the file QFile is

---- 8< -----
#include "qfile.h"
---- 8< -----

What happens is that Semantic gets confused since the include  
statement is using the syntax for local include files instead of  
system include files. Thus Semantic is unable to locate qfile.h header  
since it is located in the system include directory  
/usr/include/QtCore and the project local include path does not  
include this directory (and it should not need to do that).


Proposed solution
=================
When a system include/header file (a header file found via system  
include path) uses double quotes Semantic should treat the include  
statement as if it really was using angle brackets instead of double  
quotes and thus be able to properly locate qfile.h via QFile. As it is  
now Semantic will always mark the row with the #include <QFile> as a  
not parsed header. That is, within "system header files" (header files  
that are located via the system include path) include statements using  
angle bracket and double quote are synonyms with each other.

This change in Semantic behavior could be controlled via a setting  
that is default off in order to be backward compatible.

Note: If the Foo.cpp example source file instead looked like this

---- 8< -----
#include <qfile.h>
---- 8< -----

Semantic is able to locate the qfile.h header file and parse it.





This bug report was last modified 7 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.