Skip to content

Commit 3cdaed2

Browse files
authored
Merge pull request #141 from jbj/ql-warnings-1.18
Approved by ian-semmle
2 parents af3f855 + e0ba2b2 commit 3cdaed2

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

cpp/ql/src/semmle/code/cpp/Class.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ class Class extends UserType {
566566
* The alignment of this type in bytes (on the machine where facts were
567567
* extracted).
568568
*/
569-
int getAlignment() { usertypesize(underlyingElement(this),_,result) }
569+
override int getAlignment() { usertypesize(underlyingElement(this),_,result) }
570570

571571
/**
572572
* Holds if this class is constructed from another class as a result of

cpp/ql/src/semmle/code/cpp/File.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ abstract class Container extends Locatable, @container {
162162
*
163163
* This is the absolute path of the container.
164164
*/
165-
string toString() {
165+
override string toString() {
166166
result = getAbsolutePath()
167167
}
168168
}

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ predicate readStep(Node node1, Content f, Node node2) {
128128
* numeric conversions, and otherwise the erasure is used.
129129
*/
130130
RefType getErasedRepr(Type t) {
131+
suppressUnusedType(t) and
131132
result instanceof VoidType // stub implementation
132133
}
133134

@@ -140,6 +141,8 @@ predicate compatibleTypes(Type t1, Type t2) {
140141
any() // stub implementation
141142
}
142143

144+
private predicate suppressUnusedType(Type t) { any() }
145+
143146
//////////////////////////////////////////////////////////////////////////////
144147
// Java QL library compatibility wrappers
145148
//////////////////////////////////////////////////////////////////////////////

cpp/ql/src/semmle/code/cpp/ir/internal/PrintIRImpl.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ class PrintableFunctionIR extends PrintableIRNode, TPrintableFunctionIR {
8383
override int getOrder() {
8484
this = rank[result + 1](PrintableFunctionIR orderedFunc, Location location |
8585
location = orderedFunc.getFunctionIR().getLocation() |
86-
orderedFunc order by location.getFile().getURL(), location.getStartLine(),
86+
orderedFunc order by location.getFile().getAbsolutePath(),
87+
location.getStartLine(),
8788
location.getStartColumn(), orderedFunc.getLabel()
8889
)
8990
}

0 commit comments

Comments
 (0)