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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: johol@HIDDEN; dated Tue, 17 Apr 2018 15:00:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Apr 2018 14:59:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 17 10:59:56 2018
Received: from localhost ([127.0.0.1]:57665 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f8S5L-0001vS-DK
	for submit <at> debbugs.gnu.org; Tue, 17 Apr 2018 10:59:55 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60820)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <johol@HIDDEN>) id 1f8NQ5-0007Zp-Vo
 for submit <at> debbugs.gnu.org; Tue, 17 Apr 2018 06:01:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <johol@HIDDEN>) id 1f8NPu-0006WD-Hj
 for submit <at> debbugs.gnu.org; Tue, 17 Apr 2018 06:00:56 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:38507)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <johol@HIDDEN>)
 id 1f8NPu-0006T7-CA
 for submit <at> debbugs.gnu.org; Tue, 17 Apr 2018 06:00:50 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51706)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <johol@HIDDEN>) id 1f8NPn-00085S-Ho
 for bug-gnu-emacs@HIDDEN; Tue, 17 Apr 2018 06:00:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <johol@HIDDEN>) id 1f8NPk-0004nP-CH
 for bug-gnu-emacs@HIDDEN; Tue, 17 Apr 2018 06:00:43 -0400
Received: from mail.lysator.liu.se ([2001:6b0:17:f0a0::3]:58609)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <johol@HIDDEN>)
 id 1f8NPj-0003DH-Vp
 for bug-gnu-emacs@HIDDEN; Tue, 17 Apr 2018 06:00:40 -0400
Received: from mail.lysator.liu.se (localhost [127.0.0.1])
 by mail.lysator.liu.se (Postfix) with ESMTP id 1E11C40021
 for <bug-gnu-emacs@HIDDEN>; Tue, 17 Apr 2018 12:00:31 +0200 (CEST)
Received: by mail.lysator.liu.se (Postfix, from userid 33)
 id 07F8540003; Tue, 17 Apr 2018 12:00:30 +0200 (CEST)
Received: from proxy10.securemote.net (proxy10.securemote.net
 [136.163.203.6]) by webmail.lysator.liu.se (Horde Framework) with HTTPS;
 Tue, 17 Apr 2018 10:00:30 +0000
Date: Tue, 17 Apr 2018 10:00:30 +0000
Message-ID: <20180417100030.Horde.OolrEdLzMW9x9fJ3WI_fesU@HIDDEN>
From: johol@HIDDEN
To: bug-gnu-emacs@HIDDEN
Subject: 25.1; Semantic fails to find system include (header) files
User-Agent: Horde Application Framework 5
Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes
MIME-Version: 1.0
Content-Disposition: inline
X-Virus-Scanned: ClamAV using ClamSMTP
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.3 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 17 Apr 2018 10:59:54 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.3 (-----)

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.





Acknowledgement sent to johol@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#31198; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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