Failing to emit line directive if included file has a #if or #define on the first line
まだ誰も着手していません。
評価
調査の方向性
提供された入力 a.cpp、if.h、def.h を default_preprocessing_hooks と eat_whitespace の両方を使って問題を再現します。次に、最初に出力される内容が単一の #if、#ifdef、または #define に続くインクルードファイルについて、Wave の行ディレクティブ処理を追跡します。出力に if.h と def.h に対する期待される #line エントリが含まれ、既存の複数ディレクティブの動作が引き続き正しいことを確認できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Wave is not emitting the line directive if the first line in the included file is a #if or #ifdef that evaluates true and has content in its block. Likewise, it won't emit the line directive if the first line is a #define. This issue only occurs if there are not multiple #define or #if occurring on subsequent lines.
When using default_preprocessing_hooks, the above applies if the #if/#ifdef/#define is the first non-empty line or non-comment line. Essentially, if the directive immediately precedes the first content emitted from the included file. With eat_whitespace, the directive must be on the very first line of the include file to exhibit the issue.
Not sure if I've explained it very well, but I think an example will help better demonstrate the issue.
Example:
a.cpp
#include "if.h"
#include "def.h"
test
if.h
#if 1 //This must be on the first line for eat_whitespace, can be on 2nd, 3rd etc, for default_preprocessing_hooks as long as it's whitespace before it
if_h
#endif
def.h
#define A
def_h
Resulting preprocessed file:
a.preproc
if_h
def_h
Expected output:
#line 2 "if.h"
if_h
#line 2 "def.h"
def_h
As mentioned, the line directives do get emitted correctly if the include file is something like this:
#define A
#define B
content
So it's only occurring when there's a single directive at the beginning.
- 主要言語
- C++
- スター
- 29
- フォーク
- 56
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/wave のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
context::set_language does not correctly set __cplusplus対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
似ている issue
-
Status: Awaiting triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
espressif/arduino-esp32#12984 ·
メンテナーはふだん 1 日以内に返信
-
torch_ops/logprob.cu does not compile with the serving container's nvcc (13.3.73); check_torch_ops.py cannot run as shipped対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1時間未満 初心者へのやさしさ 72/100
ashhart/TensorFold#535 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
agent:Windows bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信