all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#31198: 25.1; Semantic fails to find system include (header) files
@ 2018-04-17 10:00 johol
  0 siblings, 0 replies; only message in thread
From: johol @ 2018-04-17 10:00 UTC (permalink / raw)
  To: 31198

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.






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-17 10:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-17 10:00 bug#31198: 25.1; Semantic fails to find system include (header) files johol

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.