Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion src/.dscanner.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if_else_same_check="enabled"
; Checks for some problems with constructors
constructor_check="enabled"
; Checks for unused function parameters
unused_parameter_check="disabled"
unused_parameter_check="enabled"
; Checks for unused variables
unused_variable_check="enabled"
; Checks for unused labels
Expand Down Expand Up @@ -119,3 +119,54 @@ builtin_property_names_check="-dmd.backend.obj,-dmd.backend.code,-dmd.backend.cc
object_const_check="-dmd.dtemplate,-dmd.backend.outbuf"
enum_array_literal_check="-dmd.backend.oper,-dmd.backend.var"
unused_variable_check="-dmd.backend.aarray,-dmd.backend.blockopt,-dmd.backend.cg,-dmd.backend.cg87,-dmd.backend.cgelem,-dmd.backend.cgobj,-dmd.backend.cgsched,-dmd.backend.cgxmm,-dmd.backend.cod1,-dmd.backend.cod2,-dmd.backend.cod3,-dmd.backend.dcgcv,-dmd.backend.dout,-dmd.backend.dwarfdbginf,-dmd.backend.elfobj,-dmd.backend.elpicpie,-dmd.backend.gother,-dmd.backend.gsroa,-dmd.backend.machobj,-dmd.backend.mscoffobj,-dmd.backend.newman,-dmd.backend.symbol,-dmd.dinterpret,-dmd.dmangle,-dmd.dsymbolsem,-dmd.dtemplate,-dmd.dump,-dmd.e2ir,-dmd.libmscoff,-dmd.mars,-dmd.ob,-dmd.objc_glue,-dmd.root.longdouble,-dmd.semantic2,-dmd.tocvdebug"

unused_parameter_check="-dmd.backend.aarray,\
-dmd.backend.blockopt,\
-dmd.backend.cc,\
-dmd.backend.cg,\
-dmd.backend.cg87,\
-dmd.backend.cgcod,\
-dmd.backend.cgelem,\
-dmd.backend.cgobj,\
-dmd.backend.cgsched,\
-dmd.backend.cgxmm,\
-dmd.backend.cod1,\
-dmd.backend.cod2,\
-dmd.backend.cod3,\
-dmd.backend.cv8,\
-dmd.backend.dcgcv,\
-dmd.backend.dlist,\
-dmd.backend.dtype,\
-dmd.backend.dwarfdbginf,\
-dmd.backend.dwarfeh,\
-dmd.backend.el,\
-dmd.backend.elfobj,\
-dmd.backend.elpicpie,\
-dmd.backend.gother,\
-dmd.backend.gsroa,\
-dmd.backend.machobj,\
-dmd.backend.mscoffobj,\
-dmd.backend.newman,\
-dmd.backend.os,\
-dmd.backend.dout,\
-dmd.backend.symbol,\
-dmd.backend.util2,\
-dmd.builtin,\
-dmd.compiler,\
-dmd.console,\
-dmd.cppmangle,\
-dmd.dmangle,\
-dmd.dsymbol,\
-dmd.dtemplate,\
-dmd.expression,\
-dmd.func,\
-dmd.gluelayer,\
-dmd.hdrgen,\
-dmd.iasmdmd,\
-dmd.inline,\
-dmd.intrange,\
-dmd.lexer,\
-dmd.mtype,\
-dmd.ob,\
-dmd.target,\
-dmd.tocvdebug"
3 changes: 1 addition & 2 deletions src/dmd/access.d
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ bool checkAccess(Loc loc, Scope* sc, Expression e, Declaration d)
* Check access to package/module `p` from scope `sc`.
*
* Params:
* loc = source location for issued error message
* sc = scope from which to access to a fully qualified package name
* p = the package/module to check access for
* Returns: true if the package is not accessible.
Expand All @@ -221,7 +220,7 @@ bool checkAccess(Loc loc, Scope* sc, Expression e, Declaration d)
* (see https://issues.dlang.org/show_bug.cgi?id=313).
*
*/
bool checkAccess(Loc loc, Scope* sc, Package p)
bool checkAccess(Scope* sc, Package p)
{
if (sc._module == p)
return false;
Expand Down
8 changes: 4 additions & 4 deletions src/dmd/astbase.d
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ struct ASTBase
return ident ? ident.toChars() : "__anonymous";
}

bool oneMember(Dsymbol *ps, Identifier ident)
bool oneMember(Dsymbol *ps, Identifier /* ident */)
{
*ps = this;
return true;
Expand Down Expand Up @@ -464,7 +464,7 @@ struct ASTBase
return null;
}

Dsymbol syntaxCopy(Dsymbol s)
Dsymbol syntaxCopy(Dsymbol /* s */)
{
return null;
}
Expand Down Expand Up @@ -1793,7 +1793,7 @@ struct ASTBase
{
size_t nargs = 0;

int dimDg(size_t n, Parameter p)
int dimDg(size_t /* n */, Parameter /* p */)
{
++nargs;
return 0;
Expand Down Expand Up @@ -6180,7 +6180,7 @@ struct ASTBase
}

// this should be abstract and implemented in child classes
Expression toExpression(Type t = null)
Expression toExpression(Type /* t */ = null)
{
return null;
}
Expand Down
1 change: 1 addition & 0 deletions src/dmd/backend/os.d
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/os.d, backend/os.d)
*/
module dmd.backend.os;

/*
* Operating system specific routines.
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -11442,7 +11442,7 @@ Expression semanticY(DotIdExp exp, Scope* sc, int flag)
if (s)
{
auto p = s.isPackage();
if (p && checkAccess(exp.loc, sc, p))
if (p && checkAccess(sc, p))
{
s = null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/todt.d
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extern (C++) void Initializer_toDt(Initializer init, ref DtBuilder dtb)
dtb.nzeros(cast(uint)vi.type.size());
}

void visitStruct(StructInitializer si)
void visitStruct(StructInitializer /* si */)
{
//printf("StructInitializer.toDt('%s')\n", si.toChars());
assert(0);
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/traits.d
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ Expression semanticTraits(TraitsExp e, Scope* sc)

auto idents = new Identifiers();

int pushIdentsDg(size_t n, Dsymbol sm)
int pushIdentsDg(size_t /* n */, Dsymbol sm)
{
if (!sm)
return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/typesem.d
Original file line number Diff line number Diff line change
Expand Up @@ -4446,7 +4446,7 @@ Expression defaultInit(Type mt, const ref Loc loc)
return mt.next.defaultInit(loc);
}

Expression visitFunction(TypeFunction mt)
Expression visitFunction(TypeFunction /* mt */)
{
error(loc, "`function` does not have a default initializer");
return new ErrorExp();
Expand Down