-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GSL violates SF.12 #1025
Comments
Hi @beinhaerter, thanks for the clear explanation of this issue. Your proposal seems good to me, I'd be happy to take a look at your PR. |
beinhaerter
pushed a commit
to beinhaerter/GSL
that referenced
this issue
Jan 31, 2022
[SF.12: Prefer the quoted form of #include for files relative to the including file and the angle bracket form everywhere else](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-incform) Additionally changed #include order in `span` so that all `span_ext` is in the GSL include block and not in the STL include block. Fixes issues microsoft#1025.
dmitrykobets-msft
pushed a commit
that referenced
this issue
Jan 31, 2022
[SF.12: Prefer the quoted form of #include for files relative to the including file and the angle bracket form everywhere else](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-incform) Additionally changed #include order in `span` so that all `span_ext` is in the GSL include block and not in the STL include block. Fixes issues #1025. Co-authored-by: Werner Henze <w.henze@avm.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SF.12: Prefer the quoted form of #include for files relative to the including file and the angle bracket form everywhere else
The GSL includes its own files as
#include <gsl/xxx>
. It would be better to use#include "xxx"
as SF.12 proposes.If you agree to SF.12, I would be ready to prepare a PR.
The way it currently is, results in problems in our projects. Following is some background.
We have a build environment which handles all projects and the include pathes. For example
Project not under my control:
Project under my control:
Project under my control:
For project3 the build environment (not under my control) uses gcc with
-Iproject1/include -Iproject2/include
.project3.cpp
uses#include <project2/project2.h>
.In this structure we want to integrate GSL. GSL cannot be a made global project, so I must make it a subfolder in a project under my control (
project2
). I want to add a new folderproject2/include/project2/gsl
with all the GSL headers likeThe GSL folder is added under
project2/include/project2/
and not underproject2/include/
so that it cannot collide if for exampleproject1
's author decides to add thegsl
folder asproject1/include/gsl
.In this setup, to use GSL,
project2
needs to write#include <project2/gsl/narrow>
.This fails because
gsl/narrow
does#include <gsl/util>
which fails. It would however work if GSL used#include "util"
as SF.12 suggests.The way we currently solve it, is to apply the changes that I ask for, in our local copy of the GSL.
The text was updated successfully, but these errors were encountered: