int main() { // or for (;;), or while (true), or do...while(true); if (true) return 0; } Such code generates (when compiled with -w) the warning "function module.main no return at end of function". But, of course, if allowed to compile, the function would return 0.
With the simplistic flow analysis in D (read: virtually none), it can't tell that the conditional is always taken. That if statement might not be optimized out until after the function "flow analysis" is done. Which is why this is a warning and not an error, or else it'd probably give the same warning for half the functions that you write. All it checks for is if the last statement of the function is a return, and in this case, it isn't.
Fixed dmd 1.032 and 2.016
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル