From: johol@lysator.liu.se
To: 31198@debbugs.gnu.org
Subject: bug#31198: 25.1; Semantic fails to find system include (header) files
Date: Tue, 17 Apr 2018 10:00:30 +0000 [thread overview]
Message-ID: <20180417100030.Horde.OolrEdLzMW9x9fJ3WI_fesU@webmail.lysator.liu.se> (raw)
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.
reply other threads:[~2018-04-17 10:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180417100030.Horde.OolrEdLzMW9x9fJ3WI_fesU@webmail.lysator.liu.se \
--to=johol@lysator.liu.se \
--cc=31198@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.