Skip to content

enum 先行宣言 (ECodeType) #2026

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gorogoro123
Copy link
Contributor

@gorogoro123 gorogoro123 commented Mar 19, 2025

PR対象

  • アプリ(サクラエディタ本体)

カテゴリ

  • 改善

PR の背景

Clang/LLVM で build時 に "-Wtautological-constant-out-of-range-compare" のwarningが出力される。
CFileLoad.cpp(299,44): warning : result of comparison of constant 65000 with expression of type 'ECodeType' is always true [-Wtautological-constant-out-of-range-compare]

仕様・動作説明

  1. enum ECodeType に基底型を追加します。
  2. StdAfx.h から #include "env/DLLSHAREDATA.h" コメントアウト時の build error を修正します。

PR の影響範囲

影響なし。

テスト内容

  1. Clang/LLVM build 時に "-Wtautological-constant-out-of-range-compare" の warning が削減されていることを確認する。
  2. 変更前後でasmが同じことを確認する。

関連 issue, PR

#1615

参考資料

https://en.cppreference.com/w/cpp/language/enum

Copy link

@AppVeyorBot
Copy link

@@ -18,7 +18,7 @@

#include "dlg/CDialog.h"

enum ECodeType;
enum ECodeType : int;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

主題「前方宣言しないと怒られる」の対策は以下で解決できそうに思います。

Suggested change
enum ECodeType : int;
#include "charset/charset.h"

主題以外の修正が多いですが、「ダメ」でない気はしてます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants