Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

C: Address remaining gcc compiler compatability issues#247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jsinglet merged 11 commits intomainfromlcartey/c-compat-fixes-2
Mar 13, 2023

Conversation

@lcartey
Copy link
Contributor

Description

This PR addresses all the remaininggcc issuesC compiler compatibility issues.

In line with the previous issues we've reviewed, the majority of the fixes are either (a) fixing test cases with syntactically invalid C code; or (b) including a different expected results file for different compilers, because the results are morally equivalent but textually different.

The sole exception in this PR isSTR37-C. This rule prohibits the use of the<ctype> functions. However, the C standard allows these "functions" to be implemented either as functions or macros, and we only detected the former. Detecting "arguments" to macros is tricky, because they are textually expanded and may appear inmultiple places in the AST generated from the macro, with no easy way to determine which aspects came from the argument itself. We handle this by looking for specific AST patterns corresponding to known, supported compilers, and identifying a "unique" element to report as the argument itself.

Fixes#246.

Finally, as an additional "bonus" I've updatedRule 2.4 to excluded template parameters.

Change request type

  • Release or process automation (GitHub workflows, internal scripts)
  • Internal documentation
  • External documentation
  • Query files (.ql,.qll,.qls or unit tests)
  • External scripts (analysis report or other code shipped as part of a release)

Rules with added or modified queries

  • No rules added
  • Queries have been added for the following rules:
    • rule number here
  • Queries have been modified for the following rules:
    • Rule 2.4
    • Rule 2.6
    • Rule 21.1
    • DCL41-C
    • Rule 8.2
    • STR34-C
    • STR37-C

Release change checklist

A change note (development_handbook.md#change-notes) is required for any pull request which modifies:

  • The structure or layout of the release artifacts.
  • The evaluation performance (memory, execution time) of an existing query.
  • The results of an existing query in any circumstance.

If you are only adding new rule queries, a change note is not required.

Author: Is a change note required?

  • Yes
  • No

🚨🚨🚨
Reviewer: Confirm that format ofshared queries (not the .qll file, the
.ql file that imports it) is valid by running them within VS Code.

  • Confirmed

Reviewer: Confirm that either a change note is not required or the change note is required and has been added.

  • Confirmed

Query development review checklist

For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:

Author

  • Have all the relevant rule package description files been checked in?
  • Have you verified that the metadata properties of each new query is set appropriately?
  • Do all the unit tests contain both "COMPLIANT" and "NON_COMPLIANT" cases?
  • Are the alert messages properly formatted and consistent with thestyle guide?
  • Have you run the queries on OpenPilot and verified that the performance and results are acceptable?
    As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
  • Does the query have an appropriate level of in-query comments/documentation?
  • Have you considered/identified possible edge cases?
  • Does the query not reinvent features in the standard library?
  • Can the query be simplified further (not golfed!)

Reviewer

  • Have all the relevant rule package description files been checked in?
  • Have you verified that the metadata properties of each new query is set appropriately?
  • Do all the unit tests contain both "COMPLIANT" and "NON_COMPLIANT" cases?
  • Are the alert messages properly formatted and consistent with thestyle guide?
  • Have you run the queries on OpenPilot and verified that the performance and results are acceptable?
    As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
  • Does the query have an appropriate level of in-query comments/documentation?
  • Have you considered/identified possible edge cases?
  • Does the query not reinvent features in the standard library?
  • Can the query be simplified further (not golfed!)

This test case had some syntactically invalid C code, and a name clash,which have now been addressed.
Labels cannot be before declarations, only before expressions orstatements.
Compliers already exclude the #define defined case.
Cases are labels, and cannot be before declarations.
This rule has a clang specific error, not permitting certain functiondeclarations. Update test case and expected results to reflect this.
For this test case our standard library stubs (MUSL) use a differentform of macro for these standard library functions that gcc and clang,so update the expected result files.
The <ctype.h> commonly implements its APIs using either macros orfunctions or some combination of the two. Our query only assumedfunctions were used, whereas macros are practically used by both gcc andclang, and these can vary depending on compiler flags.The CharFunctions.qll library now provides a unified interface fromwhich to get a unique expression for each use of an API in the library,hopefully regardless of whether it is a macro or a function. To do thiswe have had to hard code assumptions about the structure of the macros,however our matrix compiler testing should flag if these assumptions arebroken with a particular version of a supported compiler.
@github-actions
Copy link

🤖 Beep Boop! Matrix Testing for this PR has been initiated. Please check back later for results.

💡 If you do not hear back from me please check my status!I will report even if this PR does not contain files eligible for matrix testing.

@jsinglet
Copy link
Contributor

🤖 Beep Boop!clang/cpp/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

🤖 Beep Boop!gcc/cpp/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

🤖 Beep Boop!gcc/c/x86_64 Matrix Testing for this PR has been completed. See below for the results!

COMPILE_PASS         : TrueQUERY                : ToCharacterHandlingFunctionsRepresentableAsUCharRULE                 : STR37-CTEST_DIFFERENCE      : --- expected                       +++ actual                       @@ -1,28 +1,28 @@                       -| test.c:7:3:7:9 | call to isalnum | $@ to character-handling function may not be representable as an unsigned char. | test.c:7:11:7:12 | * ... | Argument |                       -| test.c:8:3:8:13 | isalpha(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:8:11:8:12 | * ... | Argument |                       -| test.c:10:3:10:9 | call to isblank | $@ to character-handling function may not be representable as an unsigned char. | test.c:10:11:10:12 | * ... | Argument |                       -| test.c:11:3:11:9 | call to iscntrl | $@ to character-handling function may not be representable as an unsigned char. | test.c:11:11:11:12 | * ... | Argument |                       -| test.c:12:3:12:13 | isdigit(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:12:3:12:13 | (...) | Argument |                       -| test.c:13:3:13:13 | isgraph(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:13:3:13:13 | (...) | Argument |                       -| test.c:14:3:14:13 | islower(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:14:3:14:13 | (...) | Argument |                       -| test.c:15:3:15:13 | isprint(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:15:3:15:13 | (...) | Argument |                       -| test.c:16:3:16:9 | call to ispunct | $@ to character-handling function may not be representable as an unsigned char. | test.c:16:11:16:12 | * ... | Argument |                       -| test.c:17:3:17:13 | call to __isspace | $@ to character-handling function may not be representable as an unsigned char. | test.c:17:11:17:12 | * ... | Argument |                       -| test.c:18:3:18:13 | isupper(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:18:3:18:13 | (...) | Argument |                       -| test.c:19:3:19:10 | call to isxdigit | $@ to character-handling function may not be representable as an unsigned char. | test.c:19:12:19:13 | * ... | Argument |                       +| test.c:7:3:7:13 | isalnum(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:7:3:7:13 | (...) | Argument |                       +| test.c:8:3:8:13 | isalpha(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:8:3:8:13 | (...) | Argument |                       +| test.c:10:3:10:13 | isblank(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:10:3:10:13 | (...) | Argument |                       +| test.c:11:3:11:13 | iscntrl(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:11:3:11:13 | (...) | Argument |                       +| test.c:12:3:12:13 | isdigit(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:12:3:12:13 | (...) | Argument |                       +| test.c:13:3:13:13 | isgraph(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:13:3:13:13 | (...) | Argument |                       +| test.c:14:3:14:13 | islower(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:14:3:14:13 | (...) | Argument |                       +| test.c:15:3:15:13 | isprint(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:15:3:15:13 | (...) | Argument |                       +| test.c:16:3:16:13 | ispunct(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:16:3:16:13 | (...) | Argument |                       +| test.c:17:3:17:13 | isspace(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:17:3:17:13 | (...) | Argument |                       +| test.c:18:3:18:13 | isupper(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:18:3:18:13 | (...) | Argument |                       +| test.c:19:3:19:14 | isxdigit(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:19:3:19:14 | (...) | Argument |                        | test.c:21:3:21:9 | call to toupper | $@ to character-handling function may not be representable as an unsigned char. | test.c:21:11:21:12 | * ... | Argument |                        | test.c:22:3:22:9 | call to tolower | $@ to character-handling function may not be representable as an unsigned char. | test.c:22:11:22:12 | * ... | Argument |                       -| test.c:70:3:70:9 | call to isalnum | $@ to character-handling function may not be representable as an unsigned char. | test.c:70:11:70:11 | t | Argument |                       -| test.c:71:3:71:12 | isalpha(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:71:11:71:11 | t | Argument |                       -| test.c:73:3:73:9 | call to isblank | $@ to character-handling function may not be representable as an unsigned char. | test.c:73:11:73:11 | t | Argument |                       -| test.c:74:3:74:9 | call to iscntrl | $@ to character-handling function may not be representable as an unsigned char. | test.c:74:11:74:11 | t | Argument |                       -| test.c:75:3:75:12 | isdigit(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:75:3:75:12 | (...) | Argument |                       -| test.c:76:3:76:12 | isgraph(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:76:3:76:12 | (...) | Argument |                       -| test.c:77:3:77:12 | islower(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:77:3:77:12 | (...) | Argument |                       -| test.c:78:3:78:12 | isprint(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:78:3:78:12 | (...) | Argument |                       -| test.c:79:3:79:9 | call to ispunct | $@ to character-handling function may not be representable as an unsigned char. | test.c:79:11:79:11 | t | Argument |                       -| test.c:80:3:80:12 | call to __isspace | $@ to character-handling function may not be representable as an unsigned char. | test.c:80:11:80:11 | t | Argument |                       -| test.c:81:3:81:12 | isupper(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:81:3:81:12 | (...) | Argument |                       -| test.c:82:3:82:10 | call to isxdigit | $@ to character-handling function may not be representable as an unsigned char. | test.c:82:12:82:12 | t | Argument |                       +| test.c:70:3:70:12 | isalnum(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:70:3:70:12 | (...) | Argument |                       +| test.c:71:3:71:12 | isalpha(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:71:3:71:12 | (...) | Argument |                       +| test.c:73:3:73:12 | isblank(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:73:3:73:12 | (...) | Argument |                       +| test.c:74:3:74:12 | iscntrl(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:74:3:74:12 | (...) | Argument |                       +| test.c:75:3:75:12 | isdigit(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:75:3:75:12 | (...) | Argument |                       +| test.c:76:3:76:12 | isgraph(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:76:3:76:12 | (...) | Argument |                       +| test.c:77:3:77:12 | islower(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:77:3:77:12 | (...) | Argument |                       +| test.c:78:3:78:12 | isprint(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:78:3:78:12 | (...) | Argument |                       +| test.c:79:3:79:12 | ispunct(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:79:3:79:12 | (...) | Argument |                       +| test.c:80:3:80:12 | isspace(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:80:3:80:12 | (...) | Argument |                       +| test.c:81:3:81:12 | isupper(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:81:3:81:12 | (...) | Argument |                       +| test.c:82:3:82:13 | isxdigit(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:82:3:82:13 | (...) | Argument |                        | test.c:84:3:84:9 | call to toupper | $@ to character-handling function may not be representable as an unsigned char. | test.c:84:11:84:11 | t | Argument |                        | test.c:85:3:85:9 | call to tolower | $@ to character-handling function may not be representable as an unsigned char. | test.c:85:11:85:11 | t | Argument |                       [1/1 comp 36.7s eval 1.3s] FAILED(RESULT) /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/c/cert/test/rules/STR37-C/ToCharacterHandlingFunctionsRepresentableAsUChar.qlref                       PACKAGE              : Strings2COMPILE_ERROR_OUTPUT : TEST_PASS            : FalseSUITE                : CERT-CCOMPILE_PASS         : TrueQUERY                : VariablesInsideSwitchStatementRULE                 : DCL41-CTEST_DIFFERENCE      : PACKAGE              : Declarations2COMPILE_ERROR_OUTPUT : TEST_PASS            : TrueSUITE                : CERT-CCOMPILE_PASS         : TrueQUERY                : CastCharBeforeConvertingToLargerSizesRULE                 : STR34-CTEST_DIFFERENCE      : PACKAGE              : Strings3COMPILE_ERROR_OUTPUT : TEST_PASS            : TrueSUITE                : CERT-CCOMPILE_PASS         : TrueQUERY                : UnusedTagDeclarationRULE                 : RULE-2-4TEST_DIFFERENCE      : PACKAGE              : DeadCodeCOMPILE_ERROR_OUTPUT : TEST_PASS            : TrueSUITE                : MISRA-C-2012COMPILE_PASS         : TrueQUERY                : UnusedLabelDeclarationRULE                 : RULE-2-6TEST_DIFFERENCE      : PACKAGE              : DeadCodeCOMPILE_ERROR_OUTPUT : TEST_PASS            : TrueSUITE                : MISRA-C-2012COMPILE_PASS         : TrueQUERY                : DefineAndUndefUsedOnReservedIdentifierOrMacroNameRULE                 : RULE-21-1TEST_DIFFERENCE      : PACKAGE              : Preprocessor4COMPILE_ERROR_OUTPUT : TEST_PASS            : TrueSUITE                : MISRA-C-2012COMPILE_PASS         : TrueQUERY                : FunctionTypesNotInPrototypeFormRULE                 : RULE-8-2TEST_DIFFERENCE      : PACKAGE              : Declarations4COMPILE_ERROR_OUTPUT : TEST_PASS            : TrueSUITE                : MISRA-C-2012

@jsinglet
Copy link
Contributor

🤖 Beep Boop!clang/c/x86_64 Matrix Testing for this PR has been completed. See below for the results!

TEST_PASS            : FalsePACKAGE              : Strings2RULE                 : STR37-CCOMPILE_PASS         : TrueQUERY                : ToCharacterHandlingFunctionsRepresentableAsUCharSUITE                : CERT-CCOMPILE_ERROR_OUTPUT : TEST_DIFFERENCE      : --- expected                       +++ actual                       @@ -1,28 +1,28 @@                       -| test.c:7:3:7:9 | call to isalnum | $@ to character-handling function may not be representable as an unsigned char. | test.c:7:11:7:12 | * ... | Argument |                       -| test.c:8:3:8:13 | isalpha(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:8:11:8:12 | * ... | Argument |                       -| test.c:10:3:10:9 | call to isblank | $@ to character-handling function may not be representable as an unsigned char. | test.c:10:11:10:12 | * ... | Argument |                       -| test.c:11:3:11:9 | call to iscntrl | $@ to character-handling function may not be representable as an unsigned char. | test.c:11:11:11:12 | * ... | Argument |                       -| test.c:12:3:12:13 | isdigit(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:12:3:12:13 | (...) | Argument |                       -| test.c:13:3:13:13 | isgraph(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:13:3:13:13 | (...) | Argument |                       -| test.c:14:3:14:13 | islower(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:14:3:14:13 | (...) | Argument |                       -| test.c:15:3:15:13 | isprint(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:15:3:15:13 | (...) | Argument |                       -| test.c:16:3:16:9 | call to ispunct | $@ to character-handling function may not be representable as an unsigned char. | test.c:16:11:16:12 | * ... | Argument |                       -| test.c:17:3:17:13 | call to __isspace | $@ to character-handling function may not be representable as an unsigned char. | test.c:17:11:17:12 | * ... | Argument |                       -| test.c:18:3:18:13 | isupper(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:18:3:18:13 | (...) | Argument |                       -| test.c:19:3:19:10 | call to isxdigit | $@ to character-handling function may not be representable as an unsigned char. | test.c:19:12:19:13 | * ... | Argument |                       +| test.c:7:3:7:13 | isalnum(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:7:3:7:13 | (...) | Argument |                       +| test.c:8:3:8:13 | isalpha(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:8:3:8:13 | (...) | Argument |                       +| test.c:10:3:10:13 | isblank(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:10:3:10:13 | (...) | Argument |                       +| test.c:11:3:11:13 | iscntrl(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:11:3:11:13 | (...) | Argument |                       +| test.c:12:3:12:13 | isdigit(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:12:3:12:13 | (...) | Argument |                       +| test.c:13:3:13:13 | isgraph(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:13:3:13:13 | (...) | Argument |                       +| test.c:14:3:14:13 | islower(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:14:3:14:13 | (...) | Argument |                       +| test.c:15:3:15:13 | isprint(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:15:3:15:13 | (...) | Argument |                       +| test.c:16:3:16:13 | ispunct(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:16:3:16:13 | (...) | Argument |                       +| test.c:17:3:17:13 | isspace(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:17:3:17:13 | (...) | Argument |                       +| test.c:18:3:18:13 | isupper(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:18:3:18:13 | (...) | Argument |                       +| test.c:19:3:19:14 | isxdigit(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:19:3:19:14 | (...) | Argument |                        | test.c:21:3:21:9 | call to toupper | $@ to character-handling function may not be representable as an unsigned char. | test.c:21:11:21:12 | * ... | Argument |                        | test.c:22:3:22:9 | call to tolower | $@ to character-handling function may not be representable as an unsigned char. | test.c:22:11:22:12 | * ... | Argument |                       -| test.c:70:3:70:9 | call to isalnum | $@ to character-handling function may not be representable as an unsigned char. | test.c:70:11:70:11 | t | Argument |                       -| test.c:71:3:71:12 | isalpha(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:71:11:71:11 | t | Argument |                       -| test.c:73:3:73:9 | call to isblank | $@ to character-handling function may not be representable as an unsigned char. | test.c:73:11:73:11 | t | Argument |                       -| test.c:74:3:74:9 | call to iscntrl | $@ to character-handling function may not be representable as an unsigned char. | test.c:74:11:74:11 | t | Argument |                       -| test.c:75:3:75:12 | isdigit(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:75:3:75:12 | (...) | Argument |                       -| test.c:76:3:76:12 | isgraph(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:76:3:76:12 | (...) | Argument |                       -| test.c:77:3:77:12 | islower(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:77:3:77:12 | (...) | Argument |                       -| test.c:78:3:78:12 | isprint(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:78:3:78:12 | (...) | Argument |                       -| test.c:79:3:79:9 | call to ispunct | $@ to character-handling function may not be representable as an unsigned char. | test.c:79:11:79:11 | t | Argument |                       -| test.c:80:3:80:12 | call to __isspace | $@ to character-handling function may not be representable as an unsigned char. | test.c:80:11:80:11 | t | Argument |                       -| test.c:81:3:81:12 | isupper(a) | $@ to character-handling function may not be representable as an unsigned char. | test.c:81:3:81:12 | (...) | Argument |                       -| test.c:82:3:82:10 | call to isxdigit | $@ to character-handling function may not be representable as an unsigned char. | test.c:82:12:82:12 | t | Argument |                       +| test.c:70:3:70:12 | isalnum(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:70:3:70:12 | (...) | Argument |                       +| test.c:71:3:71:12 | isalpha(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:71:3:71:12 | (...) | Argument |                       +| test.c:73:3:73:12 | isblank(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:73:3:73:12 | (...) | Argument |                       +| test.c:74:3:74:12 | iscntrl(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:74:3:74:12 | (...) | Argument |                       +| test.c:75:3:75:12 | isdigit(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:75:3:75:12 | (...) | Argument |                       +| test.c:76:3:76:12 | isgraph(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:76:3:76:12 | (...) | Argument |                       +| test.c:77:3:77:12 | islower(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:77:3:77:12 | (...) | Argument |                       +| test.c:78:3:78:12 | isprint(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:78:3:78:12 | (...) | Argument |                       +| test.c:79:3:79:12 | ispunct(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:79:3:79:12 | (...) | Argument |                       +| test.c:80:3:80:12 | isspace(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:80:3:80:12 | (...) | Argument |                       +| test.c:81:3:81:12 | isupper(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:81:3:81:12 | (...) | Argument |                       +| test.c:82:3:82:13 | isxdigit(c) | $@ to character-handling function may not be representable as an unsigned char. | test.c:82:3:82:13 | (...) | Argument |                        | test.c:84:3:84:9 | call to toupper | $@ to character-handling function may not be representable as an unsigned char. | test.c:84:11:84:11 | t | Argument |                        | test.c:85:3:85:9 | call to tolower | $@ to character-handling function may not be representable as an unsigned char. | test.c:85:11:85:11 | t | Argument |                       [1/1 comp 37.8s eval 1.6s] FAILED(RESULT) /__w/codeql-coding-standards-release-engineering/codeql-coding-standards-release-engineering/codeql-coding-standards/c/cert/test/rules/STR37-C/ToCharacterHandlingFunctionsRepresentableAsUChar.qlref                       TEST_PASS            : TruePACKAGE              : Declarations2RULE                 : DCL41-CCOMPILE_PASS         : TrueQUERY                : VariablesInsideSwitchStatementSUITE                : CERT-CCOMPILE_ERROR_OUTPUT : TEST_DIFFERENCE      : TEST_PASS            : TruePACKAGE              : Strings3RULE                 : STR34-CCOMPILE_PASS         : TrueQUERY                : CastCharBeforeConvertingToLargerSizesSUITE                : CERT-CCOMPILE_ERROR_OUTPUT : TEST_DIFFERENCE      : TEST_PASS            : TruePACKAGE              : DeadCodeRULE                 : RULE-2-4COMPILE_PASS         : TrueQUERY                : UnusedTagDeclarationSUITE                : MISRA-C-2012COMPILE_ERROR_OUTPUT : TEST_DIFFERENCE      : TEST_PASS            : TruePACKAGE              : DeadCodeRULE                 : RULE-2-6COMPILE_PASS         : TrueQUERY                : UnusedLabelDeclarationSUITE                : MISRA-C-2012COMPILE_ERROR_OUTPUT : TEST_DIFFERENCE      : TEST_PASS            : TruePACKAGE              : Preprocessor4RULE                 : RULE-21-1COMPILE_PASS         : TrueQUERY                : DefineAndUndefUsedOnReservedIdentifierOrMacroNameSUITE                : MISRA-C-2012COMPILE_ERROR_OUTPUT : TEST_DIFFERENCE      : TEST_PASS            : TruePACKAGE              : Declarations4RULE                 : RULE-8-2COMPILE_PASS         : TrueQUERY                : FunctionTypesNotInPrototypeFormSUITE                : MISRA-C-2012COMPILE_ERROR_OUTPUT : TEST_DIFFERENCE      :

@jsinglet
Copy link
Contributor

🤖 Beep Boop! Matrix Testing for this PR has beencompleted. If no reports were posted it means this PR does not contain things that need matrix testing!

@github-actions
Copy link

🤖 Beep Boop! Matrix Testing for this PR has been initiated. Please check back later for results.

💡 If you do not hear back from me please check my status!I will report even if this PR does not contain files eligible for matrix testing.

@jsinglet
Copy link
Contributor

🤖 Beep Boop!clang/cpp/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

🤖 Beep Boop!gcc/cpp/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

🤖 Beep Boop!clang/c/x86_64 Matrix Testing for this PR has been completed. See below for the results!

TEST_DIFFERENCE      : TEST_PASS            : TrueRULE                 : STR37-CQUERY                : ToCharacterHandlingFunctionsRepresentableAsUCharCOMPILE_PASS         : TruePACKAGE              : Strings2COMPILE_ERROR_OUTPUT : SUITE                : CERT-CTEST_DIFFERENCE      : TEST_PASS            : TrueRULE                 : DCL41-CQUERY                : VariablesInsideSwitchStatementCOMPILE_PASS         : TruePACKAGE              : Declarations2COMPILE_ERROR_OUTPUT : SUITE                : CERT-CTEST_DIFFERENCE      : TEST_PASS            : TrueRULE                 : STR34-CQUERY                : CastCharBeforeConvertingToLargerSizesCOMPILE_PASS         : TruePACKAGE              : Strings3COMPILE_ERROR_OUTPUT : SUITE                : CERT-CTEST_DIFFERENCE      : TEST_PASS            : TrueRULE                 : RULE-2-4QUERY                : UnusedTagDeclarationCOMPILE_PASS         : TruePACKAGE              : DeadCodeCOMPILE_ERROR_OUTPUT : SUITE                : MISRA-C-2012TEST_DIFFERENCE      : TEST_PASS            : TrueRULE                 : RULE-2-6QUERY                : UnusedLabelDeclarationCOMPILE_PASS         : TruePACKAGE              : DeadCodeCOMPILE_ERROR_OUTPUT : SUITE                : MISRA-C-2012TEST_DIFFERENCE      : TEST_PASS            : TrueRULE                 : RULE-21-1QUERY                : DefineAndUndefUsedOnReservedIdentifierOrMacroNameCOMPILE_PASS         : TruePACKAGE              : Preprocessor4COMPILE_ERROR_OUTPUT : SUITE                : MISRA-C-2012TEST_DIFFERENCE      : TEST_PASS            : TrueRULE                 : RULE-8-2QUERY                : FunctionTypesNotInPrototypeFormCOMPILE_PASS         : TruePACKAGE              : Declarations4COMPILE_ERROR_OUTPUT : SUITE                : MISRA-C-2012

@jsinglet
Copy link
Contributor

🤖 Beep Boop!gcc/c/x86_64 Matrix Testing for this PR has been completed. See below for the results!

TEST_PASS            : TrueRULE                 : STR37-CQUERY                : ToCharacterHandlingFunctionsRepresentableAsUCharTEST_DIFFERENCE      : COMPILE_PASS         : TrueSUITE                : CERT-CCOMPILE_ERROR_OUTPUT : PACKAGE              : Strings2TEST_PASS            : TrueRULE                 : DCL41-CQUERY                : VariablesInsideSwitchStatementTEST_DIFFERENCE      : COMPILE_PASS         : TrueSUITE                : CERT-CCOMPILE_ERROR_OUTPUT : PACKAGE              : Declarations2TEST_PASS            : TrueRULE                 : STR34-CQUERY                : CastCharBeforeConvertingToLargerSizesTEST_DIFFERENCE      : COMPILE_PASS         : TrueSUITE                : CERT-CCOMPILE_ERROR_OUTPUT : PACKAGE              : Strings3TEST_PASS            : TrueRULE                 : RULE-2-4QUERY                : UnusedTagDeclarationTEST_DIFFERENCE      : COMPILE_PASS         : TrueSUITE                : MISRA-C-2012COMPILE_ERROR_OUTPUT : PACKAGE              : DeadCodeTEST_PASS            : TrueRULE                 : RULE-2-6QUERY                : UnusedLabelDeclarationTEST_DIFFERENCE      : COMPILE_PASS         : TrueSUITE                : MISRA-C-2012COMPILE_ERROR_OUTPUT : PACKAGE              : DeadCodeTEST_PASS            : TrueRULE                 : RULE-21-1QUERY                : DefineAndUndefUsedOnReservedIdentifierOrMacroNameTEST_DIFFERENCE      : COMPILE_PASS         : TrueSUITE                : MISRA-C-2012COMPILE_ERROR_OUTPUT : PACKAGE              : Preprocessor4TEST_PASS            : TrueRULE                 : RULE-8-2QUERY                : FunctionTypesNotInPrototypeFormTEST_DIFFERENCE      : COMPILE_PASS         : TrueSUITE                : MISRA-C-2012COMPILE_ERROR_OUTPUT : PACKAGE              : Declarations4

@jsinglet
Copy link
Contributor

🤖 Beep Boop! Matrix Testing for this PR has beencompleted. If no reports were posted it means this PR does not contain things that need matrix testing!

Copy link
Contributor

@jsingletjsinglet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Great work@lcartey! Make sure to close the backing issues before/after merging!

@jsingletjsinglet added this pull request to themerge queueMar 13, 2023
Merged via the queue intomain with commit466eae8Mar 13, 2023
@jsingletjsinglet deleted the lcartey/c-compat-fixes-2 branchMarch 13, 2023 19:44
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@jsingletjsingletjsinglet approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

STR37-C:<ctype> functions implemented as macros not properly detected

3 participants

@lcartey@jsinglet

[8]ページ先頭

©2009-2025 Movatter.jp