Skip to content

A3-9-1: Consider excluding or separating char case #153

@lcartey

Description

@lcartey

Affected rules

  • A3-9-1

Description

This rule is intended to prevent the use of "basic numerical types". It cites char as one such type, however char is an interesting case because it's intended primarily to store character data not numeric data. The signed char and unsigned char types, which are distinct, are intended to represent numeric data, and, unlike char, are part of the standard integer types.

We should consider either:

  1. Splitting the char case into a new query, so that users can apply a deviation.
  2. Excluding chars, and adding an "Implementation scope" note to specify that we do not enforce this part of the standard.

Example

char x; // compliant? separate rule?
signed char x; // NON_COMPLIANT
unsigned char x; // NON_COMPLIANT

Metadata

Metadata

Assignees

Labels

Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-Mediumfalse positive/false negativeAn issue related to observed false positives or false negatives.user-reportIssue reported by an end user of CodeQL Coding Standards

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions