www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Should the -w flag also halt on ddoc warnings?

reply "Gary Willoughby" <dev nomad.so> writes:
import std.stdio;

/**
  * The main entry point.
  *
  * Params:
  *     x = command line args.
  */
void main(string[] args)
{
	writeln("hello");
}

Compile with: rdmd -D -w test.d

Output:

test.d(9): Warning: Ddoc: function declaration has no parameter 
'x'
test.d(9): Warning: Ddoc: function declaration has no parameter 
'x'
hello

Using the -w flag, compilation halts on warnings but for ddoc 
warnings it doesn't. Is this intended behaviour because i find it 
confusing and inconsistent.
Nov 13 2013
next sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
Gary Willoughby:

 Using the -w flag, compilation halts on warnings but for ddoc 
 warnings it doesn't. Is this intended behaviour because i find 
 it confusing and inconsistent.
For consistency my answer is probably yes. Bye, bearophile
Nov 13 2013
prev sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Wednesday, November 13, 2013 12:52:56 Gary Willoughby wrote:
 import std.stdio;
 
 /**
   * The main entry point.
   *
   * Params:
   *     x = command line args.
   */
 void main(string[] args)
 {
 	writeln("hello");
 }
 
 Compile with: rdmd -D -w test.d
 
 Output:
 
 test.d(9): Warning: Ddoc: function declaration has no parameter
 'x'
 test.d(9): Warning: Ddoc: function declaration has no parameter
 'x'
 hello
 
 Using the -w flag, compilation halts on warnings but for ddoc
 warnings it doesn't. Is this intended behaviour because i find it
 confusing and inconsistent.
Honestly, -w shouldn't even exist. It changes the behavior of code which does introspection. And having it error out on _more_ stuff wouldn't help any. - Jonathan M Davis
Nov 13 2013