GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — C++: Minor textual fixes · hacku7/codeql@0bcee84

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • cpp
    • downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68
      • upgrade.properties
    • ql/lib
      • change-notes
        • 2025-04-15-field-array-designator.md
      • semmle/code/cpp/exprs
        • Literal.qll
      • upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53
        • upgrade.properties
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties‎

Copy file name to clipboard
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral`
1+
description: add `hasDesignator` predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral`
22
compatibility: backwards
33
aggregate_array_init.rel: run aggregate_array_init.qlo
4-
aggregate_field_init.rel: run aggregate_field_init.qlo
4+
aggregate_field_init.rel: run aggregate_field_init.qlo
Collapse file

‎cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md‎

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
category: feature
33
---
4-
* Introduced `isDesignatorInit()` predicates to distinguish between designator-based and positional initializations for both struct/union fields and array elements.
4+
* Introduced `hasDesignator()` predicates to distinguish between designated and positional initializations for both struct/union fields and array elements.
Collapse file

‎cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll‎

Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll
+10-13Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -218,20 +218,17 @@ class ClassAggregateLiteral extends AggregateLiteral {
218218

219219
/**
220220
* Holds if the `position`-th initialization of `field` in this aggregate initializer
221-
* uses a designator (e.g., `.x =`, `[42] =`) rather than a positional initializer.
221+
* uses a designated (e.g., `.x = ...`) rather than a positional initializer.
222222
*
223-
* This can be used to distinguish explicitly designated initializations from
224-
* implicit positional ones.
225-
*
226-
* For example, in the initializer:
223+
* For example, in:
227224
* ```c
228225
* struct S { int x, y; };
229226
* struct S s = { .x = 1, 2 };
230227
* ```
231-
* - `.x = 1` is a designator init, therefore `isDesignatorInit(x, 0)` holds.
232-
* - `2` is a positional init for `.y`, therefore `isDesignatorInit(y, 1)` does **not** hold.
228+
* - `.x = 1` is a designated initializer, therefore `hasDesignator(x, 0)` holds.
229+
* - `2` is a positional initializer for `s.y`, therefore `hasDesignator(y, 1)` does not hold.
233230
*/
234-
predicate isDesignatorInit(Field field, int position) {
231+
predicate hasDesignator(Field field, int position) {
235232
field = classType.getAField() and
236233
aggregate_field_init(underlyingElement(this), _, unresolveElement(field), position, true)
237234
}
@@ -330,17 +327,17 @@ class ArrayOrVectorAggregateLiteral extends AggregateLiteral {
330327

331328
/**
332329
* Holds if the `position`-th initialization of the array element at `elementIndex`
333-
* in this aggregate initializer uses a designator (e.g., `[0] = ...`) rather than
334-
* an implicit positional initializer.
330+
* in this aggregate initializer uses a designated (e.g., `[0] = ...`) rather than
331+
* a positional initializer.
335332
*
336333
* For example, in:
337334
* ```c
338335
* int x[] = { [0] = 1, 2 };
339336
* ```
340-
* - `[0] = 1` is a designator init, therefore `isDesignatorInit(0, 0)` holds.
341-
* - `2` is a positional init for `x[1]`, therefore `isDesignatorInit(1, 1)` does **not** hold.
337+
* - `[0] = 1` is a designated initializer, therefore `hasDesignator(0, 0)` holds.
338+
* - `2` is a positional initializer for `x[1]`, therefore `hasDesignator(1, 1)` does not hold.
342339
*/
343-
predicate isDesignatorInit(int elementIndex, int position) {
340+
predicate hasDesignator(int elementIndex, int position) {
344341
aggregate_array_init(underlyingElement(this), _, elementIndex, position, true)
345342
}
346343

Collapse file

‎cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties‎

Copy file name to clipboard
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral`
1+
description: add `hasDesignator` predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral`
22
compatibility: backwards
33
aggregate_array_init.rel: run aggregate_array_init.qlo
4-
aggregate_field_init.rel: run aggregate_field_init.qlo
4+
aggregate_field_init.rel: run aggregate_field_init.qlo

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.