Bug 9811 – Add static code analyzing (i.e. PVS-Studio-like diagnostic)

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-24T23:52:44Z
Last change time
2024-12-13T18:05:19Z
Assigned to
No Owner
Creator
Denis Shelomovskii
Moved to GitHub: dmd#18546 →

Comments

Comment #0 by verylonglogin.reg — 2013-03-24T23:52:44Z
There are things which may or may not indicate and error. Current compiler behavior is: "I'm a compiler, I can't even give a warning if there is a change for false positive, there are only warnings and errors". But it looks inconsistent with the fact a compiler tries to help the developer by doing code coverage, documentation etc. Static code analyzing is an essential task a compiler could also do and do good. Also, IMHO, compilers should do static analyzing instead of external tools. So I propose to add "-diagnostic" flag to the compiler for things Walter is "a bit uncomfortable in declaring it as always wrong" and also for things that are definitely not always wrong. There also could be different levels of such analyzing and ability to treat diagnostic warnings as errors. See also: [1] Interview of Walter Bright by Andrey Karpov http://www.viva64.com/en/b/0182/ [2] NG thread about the interview http://forum.dlang.org/thread/[email protected]
Comment #1 by robert.schadek — 2024-12-13T18:05:19Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18546 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB