問題タブ [unreachable-code]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - C# 到達不能コードが検出されました
以下のコードの i++ の時点で、Visual Studio に「到達不能なコードが検出されました」というメッセージが表示されます。私が間違ったことを見つけられますか?
java - Unreachable code error vs. dead code warning in Java under Eclipse?
Does anyone know why:
Would be reported as an "unreachable error" under Eclipse, but
Only triggers a "Dead code" warning?
The only explanation I can think of is that the Java compiler only flags the first, and that some extra analysis in Eclipse figures out the second. However, if that is the case, why can't the Java compiler figure out this case at compile time?
Wouldn't the Java compiler figure out at compile time that the if(true) has no effect, thus yielding bytecode that is essentially identical? At what point is the reachable code analysis applied?
I guess a more general way to think of this question is: "when is the reachable code analysis applied"? In the transformation of the second Java code fragment to the final bytecode, I am sure that at some point the "if(true)" runtime equivalent is removed, and the representations of the two programs become identical. Wouldn't the Java compiler then apply its reachable code analysis again?
scala - Scala コンパイラが到達不能コードと言うのはなぜですか?
私はScalaが初めてです...コードは次のとおりです。
私はそれを理解しようとしています...なぜそのエラーが発生するのですか?
注: Scala Eclipse プラグイン 2.8.0.r21376-b20100408034031 ch.epfl.lamp.sdt.feature.group を使用しています。
c++ - スイッチブロック内で
libb64 プロジェクトから取得した次のコードを見てきました。switch ブロック内の while ループの目的を理解しようとしています -
その間、何を与えることができますか?とにかく、スイッチは常にいずれかのケースのみを実行するようです。私は何か見落としてますか?
ありがとう。
c - コンパイル時に行に到達できないようにする必要があることをGCCにヒントする方法は?
コンパイラは、コードに到達できない場合に警告するスイッチを提供するのが一般的です。また、到達不能コードのアサーションを提供する一部のライブラリのマクロも確認しました。
プラグマやビルトインなど、GCC(またはその他のコンパイラ)に渡すことができるヒントはありますか?到達できないと予想される行に実際に到達できると判断された場合、コンパイル中に警告またはエラーが発生します?
次に例を示します。
これの価値は、予想される到達不能線を超える条件が変化した後、その線が実際に到達可能であることを検出することです。
asp.net - 到達不能コードが検出されました
管理を任されたMVCWebアプリケーションをデプロイする準備ができました(アプリケーションは作成しませんでした)。プロジェクトは現在、エラーなしで本番モードでコンパイルされていますが、いくつかの警告があります。正確には9です。
これで6つはテストプロジェクトに関係しますが、Webプロジェクトに関係するものは2つあります。これらのエラーは次のとおりです。
到達不能コードが検出されました
どちらの場合も、これらの警告は戻り値にスローされます。
上記の例では、「return null」行は、到達不能コードの警告をスローします。
これはばかげた質問かもしれませんが(簡単に行ってください;-))、これらの警告はアプリケーションの機能にとってどれほど重要ですか?明らかにそれらは理由がありますが、エラーではないので、それらを無視して展開しても比較的大丈夫でしょうか?
java - Java匿名内部クラスに到達できないコード
到達できないコードを記述すると、Java コンパイラがエラーを出します。例えば
ただし、どこからも到達できない匿名クラスで新しいメソッドを定義すると、コンパイラは文句を言いません。それはあなたがそれをすることを可能にします、なぜですか?例えば、
java - Java:到達不能コードを@SuppressWarningsする方法は?
デバッグ中に、到達不能なコード フラグメントが発生することがあります。警告を抑制する方法はありますか?
unreachable-code - 到達不能なコード
到達できないコードがあるのはなぜですか?